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
Section titled “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
Section titled “Extends”NetlifyClient
Type Parameters
Section titled “Type Parameters”Type Parameter |
---|
SiteConfiguration |
TeamConfiguration |
Constructors
Section titled “Constructors”new NetlifyExtensionClient()
Section titled “new NetlifyExtensionClient()”new NetlifyExtensionClient<
SiteConfiguration
,TeamConfiguration
>(netlifyToken
,extension
,__namedParameters
):NetlifyExtensionClient
<SiteConfiguration
,TeamConfiguration
>
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
netlifyToken | string |
extension | string |
__namedParameters | ExtensionClientOptions |
Returns
Section titled “Returns”NetlifyExtensionClient
<SiteConfiguration
, TeamConfiguration
>
Overrides
Section titled “Overrides”NetlifyClient.constructor
Properties
Section titled “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
Section titled “Methods”cancelSiteDeploy()
Section titled “cancelSiteDeploy()”cancelSiteDeploy(
deployId
):Promise
<object
>
Cancels an in-progress deployment.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
deployId | string |
Returns
Section titled “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
Section titled “Inherited from”NetlifyClient.cancelSiteDeploy
createBuildHook()
Section titled “createBuildHook()”createBuildHook(
siteId
,buildHook
):Promise
<BuildHookResponse
>
Creates a new build hook for a site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
buildHook | BuildHookInput |
Returns
Section titled “Returns”Promise
<BuildHookResponse
>
Inherited from
Section titled “Inherited from”NetlifyClient.createBuildHook
createEnvironmentVariable()
Section titled “createEnvironmentVariable()”createEnvironmentVariable(
__namedParameters
):Promise
<EnvironmentVariable
>
Creates a new environment variable for a site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.isSecret ? | boolean |
__namedParameters.key | string |
__namedParameters.scopes ? | EnvironmentVariableScopeType [] |
__namedParameters.siteId | string |
__namedParameters.values | EnvironmentVariableValue [] |
Returns
Section titled “Returns”Promise
<EnvironmentVariable
>
Inherited from
Section titled “Inherited from”NetlifyClient.createEnvironmentVariable
createHook()
Section titled “createHook()”createHook(
CreateHookRequest
):Promise
<CreateHookResponse
>
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
CreateHookRequest | CreateHookRequest |
Returns
Section titled “Returns”Promise
<CreateHookResponse
>
Inherited from
Section titled “Inherited from”NetlifyClient.createHook
createHookBySiteId()
Section titled “createHookBySiteId()”createHookBySiteId(
siteId
,input
):Promise
<object
>
Creates a webhook for the given site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
input | CreateHookBySiteIdInput |
Returns
Section titled “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
Section titled “Inherited from”NetlifyClient.createHookBySiteId
createOrUpdateVariable()
Section titled “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
Section titled “Parameters”Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.isSecret ? | boolean |
__namedParameters.key | string |
__namedParameters.scopes ? | EnvironmentVariableScopeType [] |
__namedParameters.siteId ? | string |
__namedParameters.value | EnvVarRequest |
Returns
Section titled “Returns”Promise
<void
>
Inherited from
Section titled “Inherited from”NetlifyClient.createOrUpdateVariable
createOrUpdateVariables()
Section titled “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
Section titled “Parameters”Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.isSecret ? | boolean |
__namedParameters.scopes ? | EnvironmentVariableScopeType [] |
__namedParameters.siteId ? | string |
__namedParameters.variables | Record <string , EnvVarRequest > |
Returns
Section titled “Returns”Promise
<void
>
Inherited from
Section titled “Inherited from”NetlifyClient.createOrUpdateVariables
createSiteBuildHook()
Section titled “createSiteBuildHook()”createSiteBuildHook(
siteId
,input
):Promise
<object
>
Creates a new build hook for a site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
input | CreateSiteBuildHookInput |
Returns
Section titled “Returns”Promise
<object
>
Name | Type |
---|---|
branch | string |
createdAt | string |
draft | boolean |
id | string |
msg | string |
siteId | string |
title | string |
url | string |
Inherited from
Section titled “Inherited from”NetlifyClient.createSiteBuildHook
createSiteConfiguration()
Section titled “createSiteConfiguration()”createSiteConfiguration(
teamId
,siteId
,config
):Promise
<WretchResponse
>
Creates a site configuration for an extension installation.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
teamId | string |
siteId | string |
config | SiteConfiguration |
Returns
Section titled “Returns”Promise
<WretchResponse
>
createSiteDeploy()
Section titled “createSiteDeploy()”createSiteDeploy(
siteId
,input
):Promise
<object
>
Creates a new deployment for a site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
input | CreateSiteDeployInput |
Returns
Section titled “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
Section titled “Inherited from”NetlifyClient.createSiteDeploy
createSiteLogDrain()
Section titled “createSiteLogDrain()”createSiteLogDrain(
siteId
,input
):Promise
<object
>
Creates a log drain for a site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
input | CreateSiteLogDrainInput |
Returns
Section titled “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
Section titled “Inherited from”NetlifyClient.createSiteLogDrain
createTeamConfiguration()
Section titled “createTeamConfiguration()”createTeamConfiguration(
teamId
,config
):Promise
<WretchResponse
>
Creates a team configuration for an extension installation.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
teamId | string |
config | TeamConfiguration |
Returns
Section titled “Returns”Promise
<WretchResponse
>
deleteBuildHook()
Section titled “deleteBuildHook()”deleteBuildHook(
siteId
,buildHookId
):Promise
<BuildHookResponse
>
Deletes a build hook for a site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
buildHookId | string |
Returns
Section titled “Returns”Promise
<BuildHookResponse
>
Inherited from
Section titled “Inherited from”NetlifyClient.deleteBuildHook
deleteDeploy()
Section titled “deleteDeploy()”deleteDeploy(
deployId
):Promise
<void
>
Deletes a deployment.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
deployId | string |
Returns
Section titled “Returns”Promise
<void
>
Inherited from
Section titled “Inherited from”NetlifyClient.deleteDeploy
deleteEnvironmentVariable()
Section titled “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
Section titled “Parameters”Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.key | string |
__namedParameters.siteId ? | string |
Returns
Section titled “Returns”Promise
<WretchResponse
>
Inherited from
Section titled “Inherited from”NetlifyClient.deleteEnvironmentVariable
deleteEnvironmentVariables()
Section titled “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
Section titled “Parameters”Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.siteId ? | string |
__namedParameters.variables | string [] |
Returns
Section titled “Returns”Promise
<void
>
Inherited from
Section titled “Inherited from”NetlifyClient.deleteEnvironmentVariables
deleteHook()
Section titled “deleteHook()”deleteHook(
hookId
):Promise
<void
>
Deletes the given webhook.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
hookId | string |
Returns
Section titled “Returns”Promise
<void
>
Inherited from
Section titled “Inherited from”NetlifyClient.deleteHook
deleteSiteBuildHook()
Section titled “deleteSiteBuildHook()”deleteSiteBuildHook(
siteId
,buildHookId
):Promise
<void
>
Deletes a build hook by site ID and build hook ID.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
buildHookId | string |
Returns
Section titled “Returns”Promise
<void
>
Inherited from
Section titled “Inherited from”NetlifyClient.deleteSiteBuildHook
deleteSiteConfiguration()
Section titled “deleteSiteConfiguration()”deleteSiteConfiguration(
teamId
,siteId
):Promise
<WretchResponse
>
Deletes a site configuration for uninstalling the extension.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
teamId | string |
siteId | string |
Returns
Section titled “Returns”Promise
<WretchResponse
>
deleteSiteForm()
Section titled “deleteSiteForm()”deleteSiteForm(
siteId
,formId
):Promise
<void
>
Deletes a form.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
formId | string |
Returns
Section titled “Returns”Promise
<void
>
Inherited from
Section titled “Inherited from”NetlifyClient.deleteSiteForm
deleteSiteLogDrain()
Section titled “deleteSiteLogDrain()”deleteSiteLogDrain(
siteId
,logDrainId
):Promise
<void
>
Deletes a log drain for a site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
logDrainId | string |
Returns
Section titled “Returns”Promise
<void
>
Inherited from
Section titled “Inherited from”NetlifyClient.deleteSiteLogDrain
deleteTeamConfiguration()
Section titled “deleteTeamConfiguration()”deleteTeamConfiguration(
teamId
):Promise
<WretchResponse
>
Deletes a team configuration for uninstalling the extension.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
teamId | string |
Returns
Section titled “Returns”Promise
<WretchResponse
>
getAccount()
Section titled “getAccount()”getAccount(
accountId
):Promise
<Account
>
Gets an account by ID and returns account information.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
accountId | string |
Returns
Section titled “Returns”Promise
<Account
>
Inherited from
Section titled “Inherited from”NetlifyClient.getAccount
getBlobStore()
Section titled “getBlobStore()”getBlobStore(
siteId
,storeName
):Store
Returns a configured @netlify/blobs#Blobs client for the given site and blob store name.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
storeName | string |
Returns
Section titled “Returns”Store
The @netlify/blobs package
Inherited from
Section titled “Inherited from”NetlifyClient.getBlobStore
getCurrentUser()
Section titled “getCurrentUser()”getCurrentUser():
Promise
<null
|User
>
getCurrentUser retrieves information about the current authenticated user. If the request is not authenticated, returns null.
Returns
Section titled “Returns”Promise
<null
| User
>
Inherited from
Section titled “Inherited from”NetlifyClient.getCurrentUser
getDeploy()
Section titled “getDeploy()”getDeploy(
deployId
):Promise
<null
|object
>
Retrieves a deployment.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
deployId | string |
Returns
Section titled “Returns”Promise
<null
| object
>
Inherited from
Section titled “Inherited from”NetlifyClient.getDeploy
getDnsForSite()
Section titled “getDnsForSite()”getDnsForSite(
siteId
):Promise
<object
[]>
Lists a site’s DNS records
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
Returns
Section titled “Returns”Promise
<object
[]>
Inherited from
Section titled “Inherited from”NetlifyClient.getDnsForSite
getEnvironmentVariables()
Section titled “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
Section titled “Parameters”Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.siteId ? | string |
Returns
Section titled “Returns”Promise
<EnvironmentVariable
[]>
Inherited from
Section titled “Inherited from”NetlifyClient.getEnvironmentVariables
getHook()
Section titled “getHook()”getHook(
hookId
):Promise
<null
|object
>
Retrieves a webhook by ID. Returns null if the webhook does not exist.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
hookId | string |
Returns
Section titled “Returns”Promise
<null
| object
>
Inherited from
Section titled “Inherited from”NetlifyClient.getHook
getSite()
Section titled “getSite()”getSite(
siteId
):Promise
<Site
>
Gets a site by ID and returns site information.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
Returns
Section titled “Returns”Promise
<Site
>
Inherited from
Section titled “Inherited from”NetlifyClient.getSite
getSiteBuild()
Section titled “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
Section titled “Parameters”Parameter | Type |
---|---|
buildId | string |
Returns
Section titled “Returns”Promise
<null
| object
>
Inherited from
Section titled “Inherited from”NetlifyClient.getSiteBuild
getSiteBuildHook()
Section titled “getSiteBuildHook()”getSiteBuildHook(
siteId
,buildHookId
):Promise
<null
|object
>
Retrieves a build hook by site ID and build hook ID.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
buildHookId | string |
Returns
Section titled “Returns”Promise
<null
| object
>
Inherited from
Section titled “Inherited from”NetlifyClient.getSiteBuildHook
getSiteConfiguration()
Section titled “getSiteConfiguration()”getSiteConfiguration(
teamId
,siteId
):Promise
<null
|ConfigurationResponse
<SiteConfiguration
>>
Returns the extension configuration for a site for the current extension.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
teamId | string |
siteId | string |
Returns
Section titled “Returns”Promise
<null
| ConfigurationResponse
<SiteConfiguration
>>
getSiteForm()
Section titled “getSiteForm()”getSiteForm(
siteId
,formId
):Promise
<null
|object
>
Gets a form.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
formId | string |
Returns
Section titled “Returns”Promise
<null
| object
>
Inherited from
Section titled “Inherited from”NetlifyClient.getSiteForm
getSiteLogDrain()
Section titled “getSiteLogDrain()”getSiteLogDrain(
siteId
,logDrainId
):Promise
<null
|object
>
Gets a log drain for a site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
logDrainId | string |
Returns
Section titled “Returns”Promise
<null
| object
>
Inherited from
Section titled “Inherited from”NetlifyClient.getSiteLogDrain
getSites()
Section titled “getSites()”getSites():
Promise
<Site
[]>
Gets all sites for an account.
Returns
Section titled “Returns”Promise
<Site
[]>
Inherited from
Section titled “Inherited from”NetlifyClient.getSites
getTeamConfiguration()
Section titled “getTeamConfiguration()”getTeamConfiguration(
teamId
):Promise
<null
|ConfigurationResponse
<TeamConfiguration
>>
Returns the extension configuration for a team for the current extension.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
teamId | string |
Returns
Section titled “Returns”Promise
<null
| ConfigurationResponse
<TeamConfiguration
>>
installExtensionOnTeam()
Section titled “installExtensionOnTeam()”installExtensionOnTeam(
teamId
):Promise
<object
>
Installs this extension for a team.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
teamId | string |
Returns
Section titled “Returns”Promise
<object
>
Name | Type |
---|---|
token | string |
listHooksBySiteId()
Section titled “listHooksBySiteId()”listHooksBySiteId(
siteId
):Promise
<object
[]>
Retrieves a list of webhooks for the given site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
Returns
Section titled “Returns”Promise
<object
[]>
Inherited from
Section titled “Inherited from”NetlifyClient.listHooksBySiteId
listSiteBuildHooks()
Section titled “listSiteBuildHooks()”listSiteBuildHooks(
siteId
):Promise
<object
[]>
Lists all build hooks for a site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
Returns
Section titled “Returns”Promise
<object
[]>
Inherited from
Section titled “Inherited from”NetlifyClient.listSiteBuildHooks
listSiteConfigurations()
Section titled “listSiteConfigurations()”listSiteConfigurations(
teamId
):Promise
<ConfigurationResponse
<SiteConfiguration
>[]>
List all site configurations for the specified team.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
teamId | string |
Returns
Section titled “Returns”Promise
<ConfigurationResponse
<SiteConfiguration
>[]>
listSiteDeploys()
Section titled “listSiteDeploys()”listSiteDeploys(
siteId
):Promise
<object
[]>
Lists deployments for a site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
Returns
Section titled “Returns”Promise
<object
[]>
Inherited from
Section titled “Inherited from”NetlifyClient.listSiteDeploys
listSiteForms()
Section titled “listSiteForms()”listSiteForms(
siteId
):Promise
<object
[]>
Lists forms for a site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
Returns
Section titled “Returns”Promise
<object
[]>
Inherited from
Section titled “Inherited from”NetlifyClient.listSiteForms
listSiteLogDrains()
Section titled “listSiteLogDrains()”listSiteLogDrains(
siteId
):Promise
<object
[]>
Lists a site’s log drains.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
Returns
Section titled “Returns”Promise
<object
[]>
Inherited from
Section titled “Inherited from”NetlifyClient.listSiteLogDrains
lockDeploy()
Section titled “lockDeploy()”lockDeploy(
deployId
):Promise
<void
>
Locks an existing deployment.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
deployId | string |
Returns
Section titled “Returns”Promise
<void
>
Inherited from
Section titled “Inherited from”NetlifyClient.lockDeploy
patchEnvironmentVariable()
Section titled “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
Section titled “Parameters”Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.context | string |
__namedParameters.contextParameter ? | string |
__namedParameters.key | string |
__namedParameters.siteId ? | string |
__namedParameters.value | string |
Returns
Section titled “Returns”Promise
<EnvironmentVariable
>
Inherited from
Section titled “Inherited from”NetlifyClient.patchEnvironmentVariable
purgeCache()
Section titled “purgeCache()”purgeCache(
siteId
,cacheTags
):Promise
<void
>
purgeCache purges cached content from Netlify’s CDN. Supports purging by Cache-Tag.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
cacheTags | string [] |
Returns
Section titled “Returns”Promise
<void
>
Inherited from
Section titled “Inherited from”NetlifyClient.purgeCache
redeploySite()
Section titled “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
Section titled “Parameters”Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.branch ? | string |
__namedParameters.siteId | string |
Returns
Section titled “Returns”Promise
<RedeploySiteResponse
>
Inherited from
Section titled “Inherited from”NetlifyClient.redeploySite
restoreSiteDeploy()
Section titled “restoreSiteDeploy()”restoreSiteDeploy(
siteId
,deployId
):Promise
<object
>
Restores a site to the specified deployment.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
deployId | string |
Returns
Section titled “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
Section titled “Inherited from”NetlifyClient.restoreSiteDeploy
rollbackSiteDeploy()
Section titled “rollbackSiteDeploy()”rollbackSiteDeploy(
siteId
):Promise
<void
>
Initiates a deployment rollback for the site, restoring the site to its previous deployment.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
Returns
Section titled “Returns”Promise
<void
>
Inherited from
Section titled “Inherited from”NetlifyClient.rollbackSiteDeploy
uninstallExtensionOnTeam()
Section titled “uninstallExtensionOnTeam()”uninstallExtensionOnTeam(
teamId
):Promise
<WretchResponse
>
Uninstalls this extension for a team, which also deletes the configuration.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
teamId | string |
Returns
Section titled “Returns”Promise
<WretchResponse
>
unlockDeploy()
Section titled “unlockDeploy()”unlockDeploy(
deployId
):Promise
<void
>
Unlocks a locked deployment.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
deployId | string |
Returns
Section titled “Returns”Promise
<void
>
Inherited from
Section titled “Inherited from”NetlifyClient.unlockDeploy
updateEnvironmentVariable()
Section titled “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
Section titled “Parameters”Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.accountId | string |
__namedParameters.isSecret ? | boolean |
__namedParameters.key | string |
__namedParameters.scopes ? | EnvironmentVariableScopeType [] |
__namedParameters.siteId ? | string |
__namedParameters.values | EnvironmentVariableValue [] |
Returns
Section titled “Returns”Promise
<EnvironmentVariable
>
Inherited from
Section titled “Inherited from”NetlifyClient.updateEnvironmentVariable
updateHook()
Section titled “updateHook()”updateHook(
hookId
,input
):Promise
<object
>
Updates a webhook by ID. Returns the updated webhook.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
hookId | string |
input | UpdateHookInput |
Returns
Section titled “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
Section titled “Inherited from”NetlifyClient.updateHook
updateSite()
Section titled “updateSite()”updateSite(
siteId
,changes
):Promise
<Site
>
Updates a site with the given changes.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
changes | Partial <Site > |
Returns
Section titled “Returns”Promise
<Site
>
Inherited from
Section titled “Inherited from”NetlifyClient.updateSite
updateSiteBuildHook()
Section titled “updateSiteBuildHook()”updateSiteBuildHook(
siteId
,buildHookId
,input
):Promise
<object
>
Updates a build hook by site ID and build hook ID.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
buildHookId | string |
input | UpdateSiteBuildHookInput |
Returns
Section titled “Returns”Promise
<object
>
Name | Type |
---|---|
branch | string |
createdAt | string |
draft | boolean |
id | string |
msg | string |
siteId | string |
title | string |
url | string |
Inherited from
Section titled “Inherited from”NetlifyClient.updateSiteBuildHook
updateSiteConfiguration()
Section titled “updateSiteConfiguration()”updateSiteConfiguration(
teamId
,siteId
,config
):Promise
<WretchResponse
>
Updates the extension configuration for a site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
teamId | string |
siteId | string |
config | SiteConfiguration |
Returns
Section titled “Returns”Promise
<WretchResponse
>
updateSiteLogDrain()
Section titled “updateSiteLogDrain()”updateSiteLogDrain(
siteId
,logDrainId
,input
):Promise
<object
>
Updates a log drain for a site.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
siteId | string |
logDrainId | string |
input | CreateSiteLogDrainInput |
Returns
Section titled “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
Section titled “Inherited from”NetlifyClient.updateSiteLogDrain
updateTeamConfiguration()
Section titled “updateTeamConfiguration()”updateTeamConfiguration(
teamId
,config
):Promise
<WretchResponse
>
Updates the extension configuration for a team.
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
teamId | string |
config | TeamConfiguration |
Returns
Section titled “Returns”Promise
<WretchResponse
>
upsertSiteConfiguration()
Section titled “upsertSiteConfiguration()”upsertSiteConfiguration(
teamId
,siteId
,config
):Promise
<WretchResponse
>
Upserts a configuration object of type ‘site’ for the extension installation
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
teamId | string |
siteId | string |
config | SiteConfiguration |
Returns
Section titled “Returns”Promise
<WretchResponse
>
upsertTeamConfiguration()
Section titled “upsertTeamConfiguration()”upsertTeamConfiguration(
teamId
,config
):Promise
<WretchResponse
>
Upserts a configuration object of type ‘team’ for the extension installation
Parameters
Section titled “Parameters”Parameter | Type |
---|---|
teamId | string |
config | TeamConfiguration |
Returns
Section titled “Returns”Promise
<WretchResponse
>