NetlifyExtensionClient
The NetlifyExtensionClient
provides different methods to interact with both the Netlify API and
the Extension API.
When you install the Netlify SDK, you have access to the TypeScript definitions directly in the
@netlify/sdk
package. You can browse through the definition files individually or review the
type definition inline, depending on your code editor.
Example
import { withNetlifySDKContext } from "@netlify/sdk/ui/functions";
export default withNetlifySDKContext((req, context) => { const { accountId, auth, client } = context;
const accountInfo = await client.getAccount(accountId);
// Using the user’s OAuth connection to make a request to a third-party API await fetch("https://api.example.com/project", { headers: { Authorization: `Bearer ${auth.providerToken}`, }, method: "POST", body: JSON.stringify({ name: `project_${accountInfo.name}`, }), });
return Response.json({});});
Extends
NetlifyClient
Type Parameters
Type Parameter |
---|
SiteConfiguration |
TeamConfiguration |
ConnectorConfiguration |
Constructors
new NetlifyExtensionClient()
new NetlifyExtensionClient<
SiteConfiguration
,TeamConfiguration
,ConnectorConfiguration
>(netlifyToken
,extension
,__namedParameters
):NetlifyExtensionClient
<SiteConfiguration
,TeamConfiguration
,ConnectorConfiguration
>
Parameters
Parameter | Type |
---|---|
netlifyToken | string |
extension | string |
__namedParameters | ExtensionClientOptions |
Returns
NetlifyExtensionClient
<SiteConfiguration
, TeamConfiguration
, ConnectorConfiguration
>
Overrides
NetlifyClient.constructor
Properties
Property | Type | Inherited from |
---|---|---|
apiKey | string | NetlifyClient.apiKey |
extension | string | - |
extensionApi | Wretch <unknown , unknown , undefined > | - |
netlifyToken? | string | - |
siteConfigId? | string | - |
teamConfigId? | string | - |
wretch | Wretch <unknown , unknown , undefined > | NetlifyClient.wretch |
Methods
cancelSiteDeploy()
cancelSiteDeploy(
deployId
):Promise
<object
>
Cancels an in-progress deployment.
Parameters
Parameter | Type |
---|---|
deployId | string |
Returns
Promise
<object
>
Name | Type |
---|---|
adminUrl | string |
availableFunctions | string [] |
branch | string |
buildId | string |
commitMessage | string |
commitRef | string |
commitUrl | string |
committer | string |
context | "production" | "branch-deploy" | "deploy-preview" |
createdAt | string |
deploySslUrl | string |
deployTime | number |
deployUrl | string |
edgeFunctionsPresent | undefined | boolean |
entryPath | string |
errorMessage | string |
expiresAt | undefined | string |
framework | string |
functionSchedules | object [] |
id | string |
locked | boolean |
manualDeploy | boolean |
name | string |
pluginState | "success" | "canceled_build" | "failed_plugin" | "failed_build" | "skipped" | "none" |
publishedAt | string |
required | string [] |
requiredFunctions | string [] |
reviewId | number |
reviewUrl | string |
screenshotUrl | string |
siteId | string |
skipped | boolean |
skippedLog | boolean |
sslUrl | string |
state | "new" | "pending_review" | "accepted" | "rejected" | "enqueued" | "building" | "uploading" | "uploaded" | "preparing" | "prepared" | "processing" | "ready" | "error" | "retrying" |
summary | object |
summary.messages | undefined | object [] |
summary.status | undefined | string |
title | string |
updatedAt | string |
url | string |
userId | string |
viewsCount | number |
Inherited from
NetlifyClient.cancelSiteDeploy
createBuildHook()
createBuildHook(
siteId
,buildHook
):Promise
<BuildHookResponse
>
Creates a new build hook for a site.
Parameters
Parameter | Type |
---|---|
siteId | string |
buildHook | BuildHookInput |
Returns
Promise
<BuildHookResponse
>
Inherited from
NetlifyClient.createBuildHook
createConnectConfiguration()
createConnectConfiguration(
__namedParameters
):Promise
<WretchResponse
>
Creates a Connect configuration for an extension installation.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.config | ConnectorConfiguration |
__namedParameters.dataLayerId | string |
__namedParameters.name | string |
__namedParameters.prefix ? | string |
__namedParameters.teamId | string |
Returns
Promise
<WretchResponse
>
createEnvironmentVariable()
createEnvironmentVariable(
__namedParameters
):Promise
<EnvironmentVariable
>
Creates a new environment variable for a site.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.isSecret ? | boolean |
__namedParameters.key | string |
__namedParameters.scopes ? | EnvironmentVariableScopeType [] |
__namedParameters.siteId | string |
__namedParameters.values | EnvironmentVariableValue [] |
Returns
Promise
<EnvironmentVariable
>
Inherited from
NetlifyClient.createEnvironmentVariable
createHook()
createHook(
CreateHookRequest
):Promise
<CreateHookResponse
>
Parameters
Parameter | Type |
---|---|
CreateHookRequest | CreateHookRequest |
Returns
Promise
<CreateHookResponse
>
Inherited from
NetlifyClient.createHook
createHookBySiteId()
createHookBySiteId(
siteId
,input
):Promise
<object
>
Creates a webhook for the given site.
Parameters
Parameter | Type |
---|---|
siteId | string |
input | CreateHookBySiteIdInput |
Returns
Promise
<object
>
Name | Type |
---|---|
actor | string |
createdAt | string |
data | object |
disabled | boolean |
event | string |
formId | string |
formName | string |
id | string |
restricted | boolean |
siteId | string |
success | boolean |
type | string |
updatedAt | string |
userId | string |
Inherited from
NetlifyClient.createHookBySiteId
createOrUpdateVariable()
createOrUpdateVariable(
__namedParameters
):Promise
<void
>
Creates or updates a single environment variable for a site when passed a siteId
. When not
passed a siteId
, operates on the team level.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.isSecret ? | boolean |
__namedParameters.key | string |
__namedParameters.scopes ? | EnvironmentVariableScopeType [] |
__namedParameters.siteId ? | string |
__namedParameters.value | EnvVarRequest |
Returns
Promise
<void
>
Inherited from
NetlifyClient.createOrUpdateVariable
createOrUpdateVariables()
createOrUpdateVariables(
__namedParameters
):Promise
<void
>
Creates or updates all environment variables in the variables
object for a site when passed a
siteId
. When not passed a siteId
, operates on the team level.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.isSecret ? | boolean |
__namedParameters.scopes ? | EnvironmentVariableScopeType [] |
__namedParameters.siteId ? | string |
__namedParameters.variables | Record <string , EnvVarRequest > |
Returns
Promise
<void
>
Inherited from
NetlifyClient.createOrUpdateVariables
createSiteBuildHook()
createSiteBuildHook(
siteId
,input
):Promise
<object
>
Creates a new build hook for a site.
Parameters
Parameter | Type |
---|---|
siteId | string |
input | CreateSiteBuildHookInput |
Returns
Promise
<object
>
Name | Type |
---|---|
branch | string |
createdAt | string |
draft | boolean |
id | string |
msg | string |
siteId | string |
title | string |
url | string |
Inherited from
NetlifyClient.createSiteBuildHook
createSiteConfiguration()
createSiteConfiguration(
teamId
,siteId
,config
):Promise
<WretchResponse
>
Creates a site configuration for an extension installation.
Parameters
Parameter | Type |
---|---|
teamId | string |
siteId | string |
config | SiteConfiguration |
Returns
Promise
<WretchResponse
>
createSiteDeploy()
createSiteDeploy(
siteId
,input
):Promise
<object
>
Creates a new deployment for a site.
Parameters
Parameter | Type |
---|---|
siteId | string |
input | CreateSiteDeployInput |
Returns
Promise
<object
>
Name | Type |
---|---|
adminUrl | string |
availableFunctions | string [] |
branch | string |
buildId | string |
commitMessage | string |
commitRef | string |
commitUrl | string |
committer | string |
context | "production" | "branch-deploy" | "deploy-preview" |
createdAt | string |
deploySslUrl | string |
deployTime | number |
deployUrl | string |
edgeFunctionsPresent | undefined | boolean |
entryPath | string |
errorMessage | string |
expiresAt | undefined | string |
framework | string |
functionSchedules | object [] |
id | string |
locked | boolean |
manualDeploy | boolean |
name | string |
pluginState | "success" | "canceled_build" | "failed_plugin" | "failed_build" | "skipped" | "none" |
publishedAt | string |
required | string [] |
requiredFunctions | string [] |
reviewId | number |
reviewUrl | string |
screenshotUrl | string |
siteId | string |
skipped | boolean |
skippedLog | boolean |
sslUrl | string |
state | "new" | "pending_review" | "accepted" | "rejected" | "enqueued" | "building" | "uploading" | "uploaded" | "preparing" | "prepared" | "processing" | "ready" | "error" | "retrying" |
summary | object |
summary.messages | undefined | object [] |
summary.status | undefined | string |
title | string |
updatedAt | string |
url | string |
userId | string |
viewsCount | number |
Inherited from
NetlifyClient.createSiteDeploy
createSiteLogDrain()
createSiteLogDrain(
siteId
,input
):Promise
<object
>
Creates a log drain for a site.
Parameters
Parameter | Type |
---|---|
siteId | string |
input | CreateSiteLogDrainInput |
Returns
Promise
<object
>
Name | Type |
---|---|
destination | string |
excludePii | undefined | boolean |
format | "json" | "ndjson" |
id | string |
logTypes | string |
serviceConfig | object |
serviceConfig.url | string |
siteId | string |
Inherited from
NetlifyClient.createSiteLogDrain
createTeamConfiguration()
createTeamConfiguration(
teamId
,config
):Promise
<WretchResponse
>
Creates a team configuration for an extension installation.
Parameters
Parameter | Type |
---|---|
teamId | string |
config | TeamConfiguration |
Returns
Promise
<WretchResponse
>
createVisualEditorConfiguration()
createVisualEditorConfiguration(
__namedParameters
):Promise
<WretchResponse
>
Creates a visual editor configuration for an extension installation.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.config | ConnectorConfiguration |
__namedParameters.name | string |
__namedParameters.notifyVisualEditor ? | boolean |
__namedParameters.prefix | string |
__namedParameters.projectId | string |
__namedParameters.siteId | string |
__namedParameters.teamId | string |
Returns
Promise
<WretchResponse
>
deleteBuildHook()
deleteBuildHook(
siteId
,buildHookId
):Promise
<BuildHookResponse
>
Deletes a build hook for a site.
Parameters
Parameter | Type |
---|---|
siteId | string |
buildHookId | string |
Returns
Promise
<BuildHookResponse
>
Inherited from
NetlifyClient.deleteBuildHook
deleteConnectConfiguration()
deleteConnectConfiguration(
__namedParameters
):Promise
<WretchResponse
>
Deletes a Connect configuration for uninstalling the extension.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.configurationId | string |
__namedParameters.dataLayerId | string |
__namedParameters.teamId | string |
Returns
Promise
<WretchResponse
>
deleteDeploy()
deleteDeploy(
deployId
):Promise
<void
>
Deletes a deployment.
Parameters
Parameter | Type |
---|---|
deployId | string |
Returns
Promise
<void
>
Inherited from
NetlifyClient.deleteDeploy
deleteEnvironmentVariable()
deleteEnvironmentVariable(
__namedParameters
):Promise
<WretchResponse
>
Deletes an environment variable for a site when passed a siteId
. When not passed a siteId
,
operates on the team level.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.key | string |
__namedParameters.siteId ? | string |
Returns
Promise
<WretchResponse
>
Inherited from
NetlifyClient.deleteEnvironmentVariable
deleteEnvironmentVariables()
deleteEnvironmentVariables(
__namedParameters
):Promise
<void
>
Deletes all environment variables specified in the variables
array for a site when passed a
siteId
. When not passed a siteId
, operates on the team level.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.siteId ? | string |
__namedParameters.variables | string [] |
Returns
Promise
<void
>
Inherited from
NetlifyClient.deleteEnvironmentVariables
deleteHook()
deleteHook(
hookId
):Promise
<void
>
Deletes the given webhook.
Parameters
Parameter | Type |
---|---|
hookId | string |
Returns
Promise
<void
>
Inherited from
NetlifyClient.deleteHook
deleteSiteBuildHook()
deleteSiteBuildHook(
siteId
,buildHookId
):Promise
<void
>
Deletes a build hook by site ID and build hook ID.
Parameters
Parameter | Type |
---|---|
siteId | string |
buildHookId | string |
Returns
Promise
<void
>
Inherited from
NetlifyClient.deleteSiteBuildHook
deleteSiteConfiguration()
deleteSiteConfiguration(
teamId
,siteId
):Promise
<WretchResponse
>
Deletes a site configuration for uninstalling the extension.
Parameters
Parameter | Type |
---|---|
teamId | string |
siteId | string |
Returns
Promise
<WretchResponse
>
deleteSiteForm()
deleteSiteForm(
siteId
,formId
):Promise
<void
>
Deletes a form.
Parameters
Parameter | Type |
---|---|
siteId | string |
formId | string |
Returns
Promise
<void
>
Inherited from
NetlifyClient.deleteSiteForm
deleteSiteLogDrain()
deleteSiteLogDrain(
siteId
,logDrainId
):Promise
<void
>
Deletes a log drain for a site.
Parameters
Parameter | Type |
---|---|
siteId | string |
logDrainId | string |
Returns
Promise
<void
>
Inherited from
NetlifyClient.deleteSiteLogDrain
deleteTeamConfiguration()
deleteTeamConfiguration(
teamId
):Promise
<WretchResponse
>
Deletes a team configuration for uninstalling the extension.
Parameters
Parameter | Type |
---|---|
teamId | string |
Returns
Promise
<WretchResponse
>
deleteVisualEditorConfiguration()
deleteVisualEditorConfiguration(
__namedParameters
):Promise
<WretchResponse
>
Deletes a visual editor configuration for uninstalling the extension.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.configurationId | string |
__namedParameters.projectId | string |
__namedParameters.siteId | string |
__namedParameters.teamId | string |
Returns
Promise
<WretchResponse
>
exchangeBuildToken()
exchangeBuildToken(
siteId
,teamId
):Promise
<BuildTokenValidationResponse
>
Validates a build token, returning the siteId and teamId if the token is valid and returning an error if the token is invalid.
Parameters
Parameter | Type |
---|---|
siteId | string |
teamId | string |
Returns
Promise
<BuildTokenValidationResponse
>
generateBuildToken()
generateBuildToken(
siteId
,teamId
):Promise
<object
>
Generates a build token for a site, allowing a build hook to use the Build Context API.
Parameters
Parameter | Type |
---|---|
siteId | string |
teamId | string |
Returns
Promise
<object
>
Name | Type |
---|---|
token | string |
getAccount()
getAccount(
accountId
):Promise
<Account
>
Gets an account by ID and returns account information.
Parameters
Parameter | Type |
---|---|
accountId | string |
Returns
Promise
<Account
>
Inherited from
NetlifyClient.getAccount
getBlobStore()
getBlobStore(
siteId
,storeName
):Store
Returns a configured @netlify/blobs#Blobs client for the given site and blob store name.
Parameters
Parameter | Type |
---|---|
siteId | string |
storeName | string |
Returns
Store
See
The @netlify/blobs package
Inherited from
NetlifyClient.getBlobStore
getConnectConfiguration()
getConnectConfiguration(
__namedParameters
):Promise
<null
|ConfigurationResponse
<ConnectorConfiguration
>>
Gets a Connect configuration by the specified team ID, data layer ID, and configuration ID.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.configurationId | string |
__namedParameters.dataLayerId | string |
__namedParameters.teamId | string |
Returns
Promise
<null
| ConfigurationResponse
<ConnectorConfiguration
>>
getCurrentUser()
getCurrentUser():
Promise
<null
|User
>
getCurrentUser retrieves information about the current authenticated user. If the request is not authenticated, returns null.
Returns
Promise
<null
| User
>
Inherited from
NetlifyClient.getCurrentUser
getDeploy()
getDeploy(
deployId
):Promise
<null
|object
>
Retrieves a deployment.
Parameters
Parameter | Type |
---|---|
deployId | string |
Returns
Promise
<null
| object
>
Inherited from
NetlifyClient.getDeploy
getDnsForSite()
getDnsForSite(
siteId
):Promise
<object
[]>
Lists a site’s DNS records
Parameters
Parameter | Type |
---|---|
siteId | string |
Returns
Promise
<object
[]>
Inherited from
NetlifyClient.getDnsForSite
getEnvironmentVariables()
getEnvironmentVariables(
__namedParameters
):Promise
<EnvironmentVariable
[]>
Gets all environment variables for a site when passed a siteId
. When not passed a siteId
,
operates on the team level.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.siteId ? | string |
Returns
Promise
<EnvironmentVariable
[]>
Inherited from
NetlifyClient.getEnvironmentVariables
getHook()
getHook(
hookId
):Promise
<null
|object
>
Retrieves a webhook by ID. Returns null if the webhook does not exist.
Parameters
Parameter | Type |
---|---|
hookId | string |
Returns
Promise
<null
| object
>
Inherited from
NetlifyClient.getHook
getSite()
getSite(
siteId
):Promise
<Site
>
Gets a site by ID and returns site information.
Parameters
Parameter | Type |
---|---|
siteId | string |
Returns
Promise
<Site
>
Inherited from
NetlifyClient.getSite
getSiteBuild()
getSiteBuild(
buildId
):Promise
<null
|object
>
getSiteBuild retrieves a site build by ID.
Returns null
when no build is found for the given ID.
Parameters
Parameter | Type |
---|---|
buildId | string |
Returns
Promise
<null
| object
>
Inherited from
NetlifyClient.getSiteBuild
getSiteBuildHook()
getSiteBuildHook(
siteId
,buildHookId
):Promise
<null
|object
>
Retrieves a build hook by site ID and build hook ID.
Parameters
Parameter | Type |
---|---|
siteId | string |
buildHookId | string |
Returns
Promise
<null
| object
>
Inherited from
NetlifyClient.getSiteBuildHook
getSiteConfiguration()
getSiteConfiguration(
teamId
,siteId
):Promise
<null
|ConfigurationResponse
<SiteConfiguration
>>
Returns the extension configuration for a site for the current extension.
Parameters
Parameter | Type |
---|---|
teamId | string |
siteId | string |
Returns
Promise
<null
| ConfigurationResponse
<SiteConfiguration
>>
getSiteForm()
getSiteForm(
siteId
,formId
):Promise
<null
|object
>
Gets a form.
Parameters
Parameter | Type |
---|---|
siteId | string |
formId | string |
Returns
Promise
<null
| object
>
Inherited from
NetlifyClient.getSiteForm
getSiteLogDrain()
getSiteLogDrain(
siteId
,logDrainId
):Promise
<null
|object
>
Gets a log drain for a site.
Parameters
Parameter | Type |
---|---|
siteId | string |
logDrainId | string |
Returns
Promise
<null
| object
>
Inherited from
NetlifyClient.getSiteLogDrain
getSites()
getSites():
Promise
<Site
[]>
Gets all sites for an account.
Returns
Promise
<Site
[]>
Inherited from
NetlifyClient.getSites
getTeamConfiguration()
getTeamConfiguration(
teamId
):Promise
<null
|ConfigurationResponse
<TeamConfiguration
>>
Returns the extension configuration for a team for the current extension.
Parameters
Parameter | Type |
---|---|
teamId | string |
Returns
Promise
<null
| ConfigurationResponse
<TeamConfiguration
>>
getVisualEditorConfiguration()
getVisualEditorConfiguration(
__namedParameters
):Promise
<null
|ConfigurationResponse
<ConnectorConfiguration
>>
Gets a visual editor configuration by the specified team ID, data layer ID, and configuration ID.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.configurationId | string |
__namedParameters.siteId | string |
__namedParameters.teamId | string |
Returns
Promise
<null
| ConfigurationResponse
<ConnectorConfiguration
>>
installExtensionOnTeam()
installExtensionOnTeam(
teamId
,hasDataIntegration
):Promise
<object
>
Installs this extension for a team.
Parameters
Parameter | Type | Default value |
---|---|---|
teamId | string | undefined |
hasDataIntegration | boolean | false |
Returns
Promise
<object
>
Name | Type |
---|---|
token | string |
listHooksBySiteId()
listHooksBySiteId(
siteId
):Promise
<object
[]>
Retrieves a list of webhooks for the given site.
Parameters
Parameter | Type |
---|---|
siteId | string |
Returns
Promise
<object
[]>
Inherited from
NetlifyClient.listHooksBySiteId
listSiteBuildHooks()
listSiteBuildHooks(
siteId
):Promise
<object
[]>
Lists all build hooks for a site.
Parameters
Parameter | Type |
---|---|
siteId | string |
Returns
Promise
<object
[]>
Inherited from
NetlifyClient.listSiteBuildHooks
listSiteConfigurations()
listSiteConfigurations(
teamId
):Promise
<ConfigurationResponse
<SiteConfiguration
>[]>
List all site configurations for the specified team.
Parameters
Parameter | Type |
---|---|
teamId | string |
Returns
Promise
<ConfigurationResponse
<SiteConfiguration
>[]>
listSiteDeploys()
listSiteDeploys(
siteId
):Promise
<object
[]>
Lists deployments for a site.
Parameters
Parameter | Type |
---|---|
siteId | string |
Returns
Promise
<object
[]>
Inherited from
NetlifyClient.listSiteDeploys
listSiteForms()
listSiteForms(
siteId
):Promise
<object
[]>
Lists forms for a site.
Parameters
Parameter | Type |
---|---|
siteId | string |
Returns
Promise
<object
[]>
Inherited from
NetlifyClient.listSiteForms
listSiteLogDrains()
listSiteLogDrains(
siteId
):Promise
<object
[]>
Lists a site’s log drains.
Parameters
Parameter | Type |
---|---|
siteId | string |
Returns
Promise
<object
[]>
Inherited from
NetlifyClient.listSiteLogDrains
lockDeploy()
lockDeploy(
deployId
):Promise
<void
>
Locks an existing deployment.
Parameters
Parameter | Type |
---|---|
deployId | string |
Returns
Promise
<void
>
Inherited from
NetlifyClient.lockDeploy
patchEnvironmentVariable()
patchEnvironmentVariable(
__namedParameters
):Promise
<EnvironmentVariable
>
Creates or updates an environment variable for a site when passed a siteId
. When not passed a
siteId
, operates on the team level.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.context | string |
__namedParameters.contextParameter ? | string |
__namedParameters.key | string |
__namedParameters.siteId ? | string |
__namedParameters.value | string |
Returns
Promise
<EnvironmentVariable
>
Inherited from
NetlifyClient.patchEnvironmentVariable
purgeCache()
purgeCache(
siteId
,cacheTags
):Promise
<void
>
purgeCache purges cached content from Netlify’s CDN. Supports purging by Cache-Tag.
Parameters
Parameter | Type |
---|---|
siteId | string |
cacheTags | string [] |
Returns
Promise
<void
>
Inherited from
NetlifyClient.purgeCache
redeploySite()
redeploySite(
__namedParameters
):Promise
<RedeploySiteResponse
>
Redeploys a site by triggering a new build. A ‘branch’ can be specified to build a specific branch. If none are specified, the default branch will be built.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.branch ? | string |
__namedParameters.siteId | string |
Returns
Promise
<RedeploySiteResponse
>
Inherited from
NetlifyClient.redeploySite
removeBuildToken()
removeBuildToken(
accountId
,siteId
):Promise
<void
>
Removes the build token for a site.
Parameters
Parameter | Type |
---|---|
accountId | string |
siteId | string |
Returns
Promise
<void
>
restoreSiteDeploy()
restoreSiteDeploy(
siteId
,deployId
):Promise
<object
>
Restores a site to the specified deployment.
Parameters
Parameter | Type |
---|---|
siteId | string |
deployId | string |
Returns
Promise
<object
>
Name | Type |
---|---|
adminUrl | string |
availableFunctions | string [] |
branch | string |
buildId | string |
commitMessage | string |
commitRef | string |
commitUrl | string |
committer | string |
context | "production" | "branch-deploy" | "deploy-preview" |
createdAt | string |
deploySslUrl | string |
deployTime | number |
deployUrl | string |
edgeFunctionsPresent | undefined | boolean |
entryPath | string |
errorMessage | string |
expiresAt | undefined | string |
framework | string |
functionSchedules | object [] |
id | string |
locked | boolean |
manualDeploy | boolean |
name | string |
pluginState | "success" | "canceled_build" | "failed_plugin" | "failed_build" | "skipped" | "none" |
publishedAt | string |
required | string [] |
requiredFunctions | string [] |
reviewId | number |
reviewUrl | string |
screenshotUrl | string |
siteId | string |
skipped | boolean |
skippedLog | boolean |
sslUrl | string |
state | "new" | "pending_review" | "accepted" | "rejected" | "enqueued" | "building" | "uploading" | "uploaded" | "preparing" | "prepared" | "processing" | "ready" | "error" | "retrying" |
summary | object |
summary.messages | undefined | object [] |
summary.status | undefined | string |
title | string |
updatedAt | string |
url | string |
userId | string |
viewsCount | number |
Inherited from
NetlifyClient.restoreSiteDeploy
rollbackSiteDeploy()
rollbackSiteDeploy(
siteId
):Promise
<void
>
Initiates a deployment rollback for the site, restoring the site to its previous deployment.
Parameters
Parameter | Type |
---|---|
siteId | string |
Returns
Promise
<void
>
Inherited from
NetlifyClient.rollbackSiteDeploy
setBuildToken()
setBuildToken(
accountId
,siteId
,token
):Promise
<void
>
Sets the build token for a site. Build tokens can be created using the generateBuildToken
method.
Parameters
Parameter | Type |
---|---|
accountId | string |
siteId | string |
token | string |
Returns
Promise
<void
>
uninstallExtensionOnTeam()
uninstallExtensionOnTeam(
teamId
):Promise
<WretchResponse
>
Uninstalls this extension for a team, which also deletes the configuration.
Parameters
Parameter | Type |
---|---|
teamId | string |
Returns
Promise
<WretchResponse
>
unlockDeploy()
unlockDeploy(
deployId
):Promise
<void
>
Unlocks a locked deployment.
Parameters
Parameter | Type |
---|---|
deployId | string |
Returns
Promise
<void
>
Inherited from
NetlifyClient.unlockDeploy
updateConnectConfiguration()
updateConnectConfiguration(
__namedParameters
):Promise
<WretchResponse
>
Updates a Connect configuration, based on the specified configuration ID.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.config | ConnectorConfiguration |
__namedParameters.configurationId | string |
__namedParameters.dataLayerId | string |
__namedParameters.name | string |
__namedParameters.prefix ? | string |
__namedParameters.teamId | string |
Returns
Promise
<WretchResponse
>
updateEnvironmentVariable()
updateEnvironmentVariable(
__namedParameters
):Promise
<EnvironmentVariable
>
Updates an existing environment variable for a site when passed a siteId
. When not passed a
siteId
, operates on the team level.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.isSecret ? | boolean |
__namedParameters.key | string |
__namedParameters.scopes ? | EnvironmentVariableScopeType [] |
__namedParameters.siteId ? | string |
__namedParameters.values | EnvironmentVariableValue [] |
Returns
Promise
<EnvironmentVariable
>
Inherited from
NetlifyClient.updateEnvironmentVariable
updateHook()
updateHook(
hookId
,input
):Promise
<object
>
Updates a webhook by ID. Returns the updated webhook.
Parameters
Parameter | Type |
---|---|
hookId | string |
input | UpdateHookInput |
Returns
Promise
<object
>
Name | Type |
---|---|
actor | string |
createdAt | string |
data | object |
disabled | boolean |
event | string |
formId | string |
formName | string |
id | string |
restricted | boolean |
siteId | string |
success | boolean |
type | string |
updatedAt | string |
userId | string |
Inherited from
NetlifyClient.updateHook
updateSite()
updateSite(
siteId
,changes
):Promise
<Site
>
Updates a site with the given changes.
Parameters
Parameter | Type |
---|---|
siteId | string |
changes | Partial <Site > |
Returns
Promise
<Site
>
Inherited from
NetlifyClient.updateSite
updateSiteBuildHook()
updateSiteBuildHook(
siteId
,buildHookId
,input
):Promise
<object
>
Updates a build hook by site ID and build hook ID.
Parameters
Parameter | Type |
---|---|
siteId | string |
buildHookId | string |
input | UpdateSiteBuildHookInput |
Returns
Promise
<object
>
Name | Type |
---|---|
branch | string |
createdAt | string |
draft | boolean |
id | string |
msg | string |
siteId | string |
title | string |
url | string |
Inherited from
NetlifyClient.updateSiteBuildHook
updateSiteConfiguration()
updateSiteConfiguration(
teamId
,siteId
,config
):Promise
<WretchResponse
>
Updates the extension configuration for a site.
Parameters
Parameter | Type |
---|---|
teamId | string |
siteId | string |
config | SiteConfiguration |
Returns
Promise
<WretchResponse
>
updateSiteLogDrain()
updateSiteLogDrain(
siteId
,logDrainId
,input
):Promise
<object
>
Updates a log drain for a site.
Parameters
Parameter | Type |
---|---|
siteId | string |
logDrainId | string |
input | CreateSiteLogDrainInput |
Returns
Promise
<object
>
Name | Type |
---|---|
destination | string |
excludePii | undefined | boolean |
format | "json" | "ndjson" |
id | string |
logTypes | string |
serviceConfig | object |
serviceConfig.url | string |
siteId | string |
Inherited from
NetlifyClient.updateSiteLogDrain
updateTeamConfiguration()
updateTeamConfiguration(
teamId
,config
):Promise
<WretchResponse
>
Updates the extension configuration for a team.
Parameters
Parameter | Type |
---|---|
teamId | string |
config | TeamConfiguration |
Returns
Promise
<WretchResponse
>
updateVisualEditorConfiguration()
updateVisualEditorConfiguration(
__namedParameters
):Promise
<WretchResponse
>
Updates a visual editor configuration, based on the specified configuration ID.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.config | ConnectorConfiguration |
__namedParameters.configurationId | string |
__namedParameters.name | string |
__namedParameters.notifyVisualEditor ? | boolean |
__namedParameters.prefix | string |
__namedParameters.projectId | string |
__namedParameters.siteId | string |
__namedParameters.teamId | string |
Returns
Promise
<WretchResponse
>
upsertSiteConfiguration()
upsertSiteConfiguration(
teamId
,siteId
,config
):Promise
<WretchResponse
>
Upserts a configuration object of type ‘site’ for the extension installation
Parameters
Parameter | Type |
---|---|
teamId | string |
siteId | string |
config | SiteConfiguration |
Returns
Promise
<WretchResponse
>
upsertTeamConfiguration()
upsertTeamConfiguration(
teamId
,config
):Promise
<WretchResponse
>
Upserts a configuration object of type ‘team’ for the extension installation
Parameters
Parameter | Type |
---|---|
teamId | string |
config | TeamConfiguration |
Returns
Promise
<WretchResponse
>