- [Instructor] With a FUNDING.yml file in a .github folder,
you can tell people how they can sponsor your work.
This file has to be stored
in the default branch to be picked up by GitHub.
The default branch is normally the main branch.
After storing the file in the right branch and location,
a sponsor panel will be shown
when users go to your repository on github.com.
Let's see how this is displayed
for a popular npm package called Chalk.
In the right metadata panel,
you can see the output of the funding file
this repository has configured.
This is the list of currently supported platforms.
Some of them I knew before researching this,
and some I had never heard of before.
GitHub Sponsors is GitHub's own platform
where you can configure a Stripe account
to receive the payment,
and then you can set up certain features for your sponsors,
like for example, private repositories
that only your sponsors can access.
Another one is Ko-fi,
which is nicely tied to the buy me coffee concept.
The last one in this list is a custom URL
that you can define if you have a platform for your sponsors
that is not one of the GitHub supported ones.
With this, you can redirect your sponsors to any valid URL.
Let's review some of the example content
of the funding configuration file.
This is a YAML file, which means that we have
a set of key value pairs that we can configure.
In this case, we see four lines configured,
which means there are four different sponsorship platforms
that we want to show our users.
The first one is the GitHub sponsorship setup
where you can configure either usernames
or organization names.
The second line is the setup for Patreon
that has a single value configured.
The last one is a custom link that you can display
so that you can go to any other platform
if it is not supported by GitHub.
If there is a colon in the link you use,
then it must be wrapped with double quotes
to prevent issues with the reading of the YAML file
since the colon is normally a delimiter
for the key value pairs.
For Tidelift, you have additional configuration options.
For each platform that Tidelift supports,
you can use the platform name
with the package name you have published there.
So from the platforms on the left, for example, npm,
you can configure this package
as tidelift:npm/my-package-name.
You can also configure the funding file
at either the account or the organization level.
You can create a .github repository,
and then create the FUNDING.yml in the .github folder.
That means you can configure one file,
and that file will be used for all repositories
in either that account or organization.
You can then always override the central configuration
for each specific repository.
In the settings for each repo,
you'll also see that as a warning.