Use cases for endpoints
One of the benefits of adding endpoints to your extension is that you can use them with Netlify’s Extension API to integrate with Netlify. This page highlights some examples.
Use a custom extension configuration
The Extension API allows you to set a custom extension configuration. This configuration is a JSON object that can be used to store any data you want on either a site or team level.
Set a custom extension configuration for a site
To set a custom extension configuration for a site, take the following steps:
- Add an endpoint.
- Call the
client.updateSiteConfiguration
method. This method takes theteamId
,siteId
, and theconfig
as arguments. Theconfig
is a JSON object that can contain any data you want.
Set a custom extension configuration for a team
To set a custom extension configuration for a team, take the following steps:
- Add an endpoint.
- Call the
client.updateTeamConfiguration
method. This method takes theteamId
and theconfig
as arguments. Theconfig
is a JSON object that can contain any data you want.
Retrieve a custom extension configuration for a site or team
After setting a custom extension configuration for a site or a team, you can retrieve it by taking the following steps:
- Add an endpoint.
- Call the
client.getSiteConfiguration
method to retrieve the custom extension configuration for a site. - Call the
client.getTeamConfiguration
method to retrieve the custom extension configuration for a team.
More resources
Visit our API reference docs for more information about the methods and properties available to you: