Files
supabase/apps/docs/spec/reference/javascript/functions.json
T
2026-05-05 21:06:58 +02:00

3810 lines
132 KiB
JSON

{
"id": 0,
"name": "@supabase/functions-js",
"variant": "project",
"kind": 1,
"flags": {},
"children": [
{
"id": 93,
"name": "FunctionRegion",
"variant": "declaration",
"kind": 8,
"flags": {},
"children": [
{
"id": 94,
"name": "Any",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 96,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L96"
}
],
"type": {
"type": "literal",
"value": "any"
}
},
{
"id": 95,
"name": "ApNortheast1",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 97,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L97"
}
],
"type": {
"type": "literal",
"value": "ap-northeast-1"
}
},
{
"id": 96,
"name": "ApNortheast2",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 98,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L98"
}
],
"type": {
"type": "literal",
"value": "ap-northeast-2"
}
},
{
"id": 97,
"name": "ApSouth1",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 99,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L99"
}
],
"type": {
"type": "literal",
"value": "ap-south-1"
}
},
{
"id": 98,
"name": "ApSoutheast1",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 100,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L100"
}
],
"type": {
"type": "literal",
"value": "ap-southeast-1"
}
},
{
"id": 99,
"name": "ApSoutheast2",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 101,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L101"
}
],
"type": {
"type": "literal",
"value": "ap-southeast-2"
}
},
{
"id": 100,
"name": "CaCentral1",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 102,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L102"
}
],
"type": {
"type": "literal",
"value": "ca-central-1"
}
},
{
"id": 101,
"name": "EuCentral1",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 103,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L103"
}
],
"type": {
"type": "literal",
"value": "eu-central-1"
}
},
{
"id": 102,
"name": "EuWest1",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 104,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L104"
}
],
"type": {
"type": "literal",
"value": "eu-west-1"
}
},
{
"id": 103,
"name": "EuWest2",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 105,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L105"
}
],
"type": {
"type": "literal",
"value": "eu-west-2"
}
},
{
"id": 104,
"name": "EuWest3",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 106,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L106"
}
],
"type": {
"type": "literal",
"value": "eu-west-3"
}
},
{
"id": 105,
"name": "SaEast1",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 107,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L107"
}
],
"type": {
"type": "literal",
"value": "sa-east-1"
}
},
{
"id": 106,
"name": "UsEast1",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 108,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L108"
}
],
"type": {
"type": "literal",
"value": "us-east-1"
}
},
{
"id": 107,
"name": "UsWest1",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 109,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L109"
}
],
"type": {
"type": "literal",
"value": "us-west-1"
}
},
{
"id": 108,
"name": "UsWest2",
"variant": "declaration",
"kind": 16,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 110,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L110"
}
],
"type": {
"type": "literal",
"value": "us-west-2"
}
}
],
"groups": [
{
"title": "Enumeration Members",
"children": [94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108]
}
],
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 95,
"character": 12,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L95"
}
]
},
{
"id": 1,
"name": "FunctionsClient",
"variant": "declaration",
"kind": 128,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "Client for invoking Supabase Edge Functions."
}
]
},
"children": [
{
"id": 2,
"name": "constructor",
"variant": "declaration",
"kind": 512,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 44,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L44"
}
],
"signatures": [
{
"id": 3,
"name": "FunctionsClient",
"variant": "signature",
"kind": 16384,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "Creates a new Functions client bound to an Edge Functions URL."
}
],
"blockTags": [
{
"tag": "@example",
"name": "Using supabase-js (recommended)",
"content": [
{
"kind": "code",
"text": "```ts\nimport { createClient } from '@supabase/supabase-js'\n\nconst supabase = createClient('https://xyzcompany.supabase.co', 'your-publishable-key')\nconst { data, error } = await supabase.functions.invoke('hello-world')\n```"
}
]
},
{
"tag": "@category",
"content": [
{
"kind": "text",
"text": "Edge Functions"
}
]
},
{
"tag": "@example",
"name": "Standalone import for bundle-sensitive environments",
"content": [
{
"kind": "code",
"text": "```ts\nimport { FunctionsClient, FunctionRegion } from '@supabase/functions-js'\n\nconst functions = new FunctionsClient('https://xyzcompany.supabase.co/functions/v1', {\n headers: { apikey: 'your-publishable-key' },\n region: FunctionRegion.UsEast1,\n})\n```"
}
]
}
]
},
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 44,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L44"
}
],
"parameters": [
{
"id": 4,
"name": "url",
"variant": "param",
"kind": 32768,
"flags": {},
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"id": 5,
"name": "__namedParameters",
"variant": "param",
"kind": 32768,
"flags": {},
"type": {
"type": "reflection",
"declaration": {
"id": 6,
"name": "__type",
"variant": "declaration",
"kind": 65536,
"flags": {},
"children": [
{
"id": 8,
"name": "customFetch",
"variant": "declaration",
"kind": 1024,
"flags": {
"isOptional": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 52,
"character": 6,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L52"
}
],
"type": {
"type": "reflection",
"declaration": {
"id": 9,
"name": "__type",
"variant": "declaration",
"kind": 65536,
"flags": {},
"sources": [
{
"fileName": "node_modules/typescript/lib/lib.dom.d.ts",
"line": 29329,
"character": 17
},
{
"fileName": "node_modules/@types/node/globals.d.ts",
"line": 289,
"character": 13
}
],
"signatures": [
{
"id": 10,
"name": "__type",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)"
}
]
},
"sources": [
{
"fileName": "node_modules/typescript/lib/lib.dom.d.ts",
"line": 29329,
"character": 17
}
],
"parameters": [
{
"id": 11,
"name": "input",
"variant": "param",
"kind": 32768,
"flags": {},
"type": {
"type": "union",
"types": [
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "RequestInfo"
},
"name": "RequestInfo",
"package": "typescript"
},
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "URL"
},
"name": "URL",
"package": "typescript"
}
]
}
},
{
"id": 12,
"name": "init",
"variant": "param",
"kind": 32768,
"flags": {
"isOptional": true
},
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "RequestInit"
},
"name": "RequestInit",
"package": "typescript"
}
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Promise"
},
"typeArguments": [
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "Response"
},
"name": "Response",
"package": "typescript"
}
],
"name": "Promise",
"package": "typescript"
}
},
{
"id": 13,
"name": "__type",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)"
}
]
},
"sources": [
{
"fileName": "node_modules/@types/node/globals.d.ts",
"line": 289,
"character": 13
}
],
"parameters": [
{
"id": 14,
"name": "input",
"variant": "param",
"kind": 32768,
"flags": {},
"type": {
"type": "union",
"types": [
{
"type": "intrinsic",
"name": "string"
},
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "Request"
},
"name": "Request",
"package": "typescript"
},
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "URL"
},
"name": "URL",
"package": "typescript"
}
]
}
},
{
"id": 15,
"name": "init",
"variant": "param",
"kind": 32768,
"flags": {
"isOptional": true
},
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "RequestInit"
},
"name": "RequestInit",
"package": "typescript"
}
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Promise"
},
"typeArguments": [
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "Response"
},
"name": "Response",
"package": "typescript"
}
],
"name": "Promise",
"package": "typescript"
}
}
]
}
}
},
{
"id": 7,
"name": "headers",
"variant": "declaration",
"kind": 1024,
"flags": {
"isOptional": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 51,
"character": 6,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L51"
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Record"
},
"typeArguments": [
{
"type": "intrinsic",
"name": "string"
},
{
"type": "intrinsic",
"name": "string"
}
],
"name": "Record",
"package": "typescript"
},
"defaultValue": "{}"
},
{
"id": 16,
"name": "region",
"variant": "declaration",
"kind": 1024,
"flags": {
"isOptional": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 53,
"character": 6,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L53"
}
],
"type": {
"type": "reference",
"target": 93,
"name": "FunctionRegion",
"package": "@supabase/functions-js"
},
"defaultValue": "FunctionRegion.Any"
}
],
"groups": [
{
"title": "Properties",
"children": [8, 7, 16]
}
],
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 50,
"character": 7,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L50"
}
]
}
},
"defaultValue": "{}"
}
],
"type": {
"type": "reference",
"target": 1,
"name": "FunctionsClient",
"package": "@supabase/functions-js"
}
}
]
},
{
"id": 20,
"name": "fetch",
"variant": "declaration",
"kind": 1024,
"flags": {
"isProtected": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 19,
"character": 12,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L19"
}
],
"type": {
"type": "reflection",
"declaration": {
"id": 21,
"name": "__type",
"variant": "declaration",
"kind": 65536,
"flags": {},
"sources": [
{
"fileName": "node_modules/typescript/lib/lib.dom.d.ts",
"line": 29329,
"character": 17
},
{
"fileName": "node_modules/@types/node/globals.d.ts",
"line": 289,
"character": 13
}
],
"signatures": [
{
"id": 22,
"name": "__type",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)"
}
]
},
"sources": [
{
"fileName": "node_modules/typescript/lib/lib.dom.d.ts",
"line": 29329,
"character": 17
}
],
"parameters": [
{
"id": 23,
"name": "input",
"variant": "param",
"kind": 32768,
"flags": {},
"type": {
"type": "union",
"types": [
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "RequestInfo"
},
"name": "RequestInfo",
"package": "typescript"
},
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "URL"
},
"name": "URL",
"package": "typescript"
}
]
}
},
{
"id": 24,
"name": "init",
"variant": "param",
"kind": 32768,
"flags": {
"isOptional": true
},
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "RequestInit"
},
"name": "RequestInit",
"package": "typescript"
}
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Promise"
},
"typeArguments": [
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "Response"
},
"name": "Response",
"package": "typescript"
}
],
"name": "Promise",
"package": "typescript"
}
},
{
"id": 25,
"name": "__type",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "[MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch)"
}
]
},
"sources": [
{
"fileName": "node_modules/@types/node/globals.d.ts",
"line": 289,
"character": 13
}
],
"parameters": [
{
"id": 26,
"name": "input",
"variant": "param",
"kind": 32768,
"flags": {},
"type": {
"type": "union",
"types": [
{
"type": "intrinsic",
"name": "string"
},
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "Request"
},
"name": "Request",
"package": "typescript"
},
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "URL"
},
"name": "URL",
"package": "typescript"
}
]
}
},
{
"id": 27,
"name": "init",
"variant": "param",
"kind": 32768,
"flags": {
"isOptional": true
},
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "RequestInit"
},
"name": "RequestInit",
"package": "typescript"
}
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Promise"
},
"typeArguments": [
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "Response"
},
"name": "Response",
"package": "typescript"
}
],
"name": "Promise",
"package": "typescript"
}
}
]
}
}
},
{
"id": 18,
"name": "headers",
"variant": "declaration",
"kind": 1024,
"flags": {
"isProtected": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 17,
"character": 12,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L17"
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Record"
},
"typeArguments": [
{
"type": "intrinsic",
"name": "string"
},
{
"type": "intrinsic",
"name": "string"
}
],
"name": "Record",
"package": "typescript"
}
},
{
"id": 19,
"name": "region",
"variant": "declaration",
"kind": 1024,
"flags": {
"isProtected": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 18,
"character": 12,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L18"
}
],
"type": {
"type": "reference",
"target": 93,
"name": "FunctionRegion",
"package": "@supabase/functions-js"
}
},
{
"id": 17,
"name": "url",
"variant": "declaration",
"kind": 1024,
"flags": {
"isProtected": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 16,
"character": 12,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L16"
}
],
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"id": 31,
"name": "invoke",
"variant": "declaration",
"kind": 2048,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 202,
"character": 8,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L202"
}
],
"signatures": [
{
"id": 32,
"name": "invoke",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "Invokes a function"
}
],
"blockTags": [
{
"tag": "@example",
"content": [
{
"kind": "code",
"text": "```ts\nconst { data, error } = await functions.invoke('hello-world', {\n body: { name: 'Ada' },\n})\n```"
}
]
},
{
"tag": "@category",
"content": [
{
"kind": "text",
"text": "Edge Functions"
}
]
},
{
"tag": "@remarks",
"content": [
{
"kind": "text",
"text": "- Requires an Authorization header.\n- Invoke params generally match the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) spec.\n- When you pass in a body to your function, we automatically attach the Content-Type header for "
},
{
"kind": "code",
"text": "`Blob`"
},
{
"kind": "text",
"text": ", "
},
{
"kind": "code",
"text": "`ArrayBuffer`"
},
{
"kind": "text",
"text": ", "
},
{
"kind": "code",
"text": "`File`"
},
{
"kind": "text",
"text": ", "
},
{
"kind": "code",
"text": "`FormData`"
},
{
"kind": "text",
"text": " and "
},
{
"kind": "code",
"text": "`String`"
},
{
"kind": "text",
"text": ". If it doesn't match any of these types we assume the payload is "
},
{
"kind": "code",
"text": "`json`"
},
{
"kind": "text",
"text": ", serialize it and attach the "
},
{
"kind": "code",
"text": "`Content-Type`"
},
{
"kind": "text",
"text": " header as "
},
{
"kind": "code",
"text": "`application/json`"
},
{
"kind": "text",
"text": ". You can override this behavior by passing in a "
},
{
"kind": "code",
"text": "`Content-Type`"
},
{
"kind": "text",
"text": " header of your own.\n- Responses are automatically parsed as "
},
{
"kind": "code",
"text": "`json`"
},
{
"kind": "text",
"text": ", "
},
{
"kind": "code",
"text": "`blob`"
},
{
"kind": "text",
"text": " and "
},
{
"kind": "code",
"text": "`form-data`"
},
{
"kind": "text",
"text": " depending on the "
},
{
"kind": "code",
"text": "`Content-Type`"
},
{
"kind": "text",
"text": " header sent by your function. Responses are parsed as "
},
{
"kind": "code",
"text": "`text`"
},
{
"kind": "text",
"text": " by default."
}
]
},
{
"tag": "@example",
"name": "Basic invocation",
"content": [
{
"kind": "code",
"text": "```js\nconst { data, error } = await supabase.functions.invoke('hello', {\n body: { foo: 'bar' }\n})\n```"
}
]
},
{
"tag": "@exampleDescription",
"content": [
{
"kind": "text",
"text": "Error handling\nA "
},
{
"kind": "code",
"text": "`FunctionsHttpError`"
},
{
"kind": "text",
"text": " error is returned if your function throws an error, "
},
{
"kind": "code",
"text": "`FunctionsRelayError`"
},
{
"kind": "text",
"text": " if the Supabase Relay has an error processing your function and "
},
{
"kind": "code",
"text": "`FunctionsFetchError`"
},
{
"kind": "text",
"text": " if there is a network error in calling your function."
}
]
},
{
"tag": "@example",
"name": "Error handling",
"content": [
{
"kind": "code",
"text": "```js\nimport { FunctionsHttpError, FunctionsRelayError, FunctionsFetchError } from \"@supabase/supabase-js\";\n\nconst { data, error } = await supabase.functions.invoke('hello', {\n headers: {\n \"my-custom-header\": 'my-custom-header-value'\n },\n body: { foo: 'bar' }\n})\n\nif (error instanceof FunctionsHttpError) {\n const errorMessage = await error.context.json()\n console.log('Function returned an error', errorMessage)\n} else if (error instanceof FunctionsRelayError) {\n console.log('Relay error:', error.message)\n} else if (error instanceof FunctionsFetchError) {\n console.log('Fetch error:', error.message)\n}\n```"
}
]
},
{
"tag": "@exampleDescription",
"content": [
{
"kind": "text",
"text": "Passing custom headers\nYou can pass custom headers to your function. Note: supabase-js automatically passes the "
},
{
"kind": "code",
"text": "`Authorization`"
},
{
"kind": "text",
"text": " header with the signed in user's JWT."
}
]
},
{
"tag": "@example",
"name": "Passing custom headers",
"content": [
{
"kind": "code",
"text": "```js\nconst { data, error } = await supabase.functions.invoke('hello', {\n headers: {\n \"my-custom-header\": 'my-custom-header-value'\n },\n body: { foo: 'bar' }\n})\n```"
}
]
},
{
"tag": "@exampleDescription",
"content": [
{
"kind": "text",
"text": "Calling with DELETE HTTP verb\nYou can also set the HTTP verb to "
},
{
"kind": "code",
"text": "`DELETE`"
},
{
"kind": "text",
"text": " when calling your Edge Function."
}
]
},
{
"tag": "@example",
"name": "Calling with DELETE HTTP verb",
"content": [
{
"kind": "code",
"text": "```js\nconst { data, error } = await supabase.functions.invoke('hello', {\n headers: {\n \"my-custom-header\": 'my-custom-header-value'\n },\n body: { foo: 'bar' },\n method: 'DELETE'\n})\n```"
}
]
},
{
"tag": "@exampleDescription",
"content": [
{
"kind": "text",
"text": "Invoking a Function in the UsEast1 region\nHere are the available regions:\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.Any`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.ApNortheast1`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.ApNortheast2`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.ApSouth1`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.ApSoutheast1`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.ApSoutheast2`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.CaCentral1`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.EuCentral1`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.EuWest1`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.EuWest2`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.EuWest3`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.SaEast1`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.UsEast1`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.UsWest1`"
},
{
"kind": "text",
"text": "\n- "
},
{
"kind": "code",
"text": "`FunctionRegion.UsWest2`"
}
]
},
{
"tag": "@example",
"name": "Invoking a Function in the UsEast1 region",
"content": [
{
"kind": "code",
"text": "```js\nimport { createClient, FunctionRegion } from '@supabase/supabase-js'\n\nconst { data, error } = await supabase.functions.invoke('hello', {\n body: { foo: 'bar' },\n region: FunctionRegion.UsEast1\n})\n```"
}
]
},
{
"tag": "@exampleDescription",
"content": [
{
"kind": "text",
"text": "Calling with GET HTTP verb\nYou can also set the HTTP verb to "
},
{
"kind": "code",
"text": "`GET`"
},
{
"kind": "text",
"text": " when calling your Edge Function."
}
]
},
{
"tag": "@example",
"name": "Calling with GET HTTP verb",
"content": [
{
"kind": "code",
"text": "```js\nconst { data, error } = await supabase.functions.invoke('hello', {\n headers: {\n \"my-custom-header\": 'my-custom-header-value'\n },\n method: 'GET'\n})\n```"
}
]
},
{
"tag": "@example",
"name": "Standalone client invoke",
"content": [
{
"kind": "code",
"text": "```ts\nconst { data, error } = await functions.invoke('hello-world', {\n body: { name: 'Ada' },\n})\n```"
}
]
}
]
},
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 202,
"character": 8,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L202"
}
],
"typeParameters": [
{
"id": 33,
"name": "T",
"variant": "typeParam",
"kind": 131072,
"flags": {},
"default": {
"type": "intrinsic",
"name": "any"
}
}
],
"parameters": [
{
"id": 34,
"name": "functionName",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "The name of the Function to invoke."
}
]
},
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"id": 35,
"name": "options",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "Options for invoking the Function."
}
]
},
"type": {
"type": "reference",
"target": 36,
"name": "FunctionInvokeOptions",
"package": "@supabase/functions-js"
},
"defaultValue": "{}"
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Promise"
},
"typeArguments": [
{
"type": "reference",
"target": 109,
"typeArguments": [
{
"type": "reference",
"target": 33,
"name": "T",
"package": "@supabase/functions-js",
"refersToTypeParameter": true
}
],
"name": "FunctionsResponse",
"package": "@supabase/functions-js"
}
],
"name": "Promise",
"package": "typescript"
}
}
]
},
{
"id": 28,
"name": "setAuth",
"variant": "declaration",
"kind": 2048,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 73,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L73"
}
],
"signatures": [
{
"id": 29,
"name": "setAuth",
"variant": "signature",
"kind": 4096,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "Updates the authorization header"
}
],
"blockTags": [
{
"tag": "@category",
"content": [
{
"kind": "text",
"text": "Edge Functions"
}
]
},
{
"tag": "@example",
"name": "Setting the authorization header",
"content": [
{
"kind": "code",
"text": "```ts\nfunctions.setAuth(session.access_token)\n```"
}
]
}
]
},
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 73,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L73"
}
],
"parameters": [
{
"id": 30,
"name": "token",
"variant": "param",
"kind": 32768,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "the new jwt token sent in the authorisation header"
}
]
},
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"type": {
"type": "intrinsic",
"name": "void"
}
}
]
}
],
"groups": [
{
"title": "Constructors",
"children": [2]
},
{
"title": "Properties",
"children": [20, 18, 19, 17]
},
{
"title": "Methods",
"children": [31, 28]
}
],
"categories": [
{
"title": "Edge Functions",
"children": [2, 31, 28]
},
{
"title": "Other",
"children": [20, 18, 19, 17]
}
],
"sources": [
{
"fileName": "packages/core/functions-js/src/FunctionsClient.ts",
"line": 15,
"character": 13,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/FunctionsClient.ts#L15"
}
]
},
{
"id": 47,
"name": "FunctionsError",
"variant": "declaration",
"kind": 128,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "Base error for Supabase Edge Function invocations."
}
],
"blockTags": [
{
"tag": "@example",
"content": [
{
"kind": "code",
"text": "```ts\nimport { FunctionsError } from '@supabase/functions-js'\n\nthrow new FunctionsError('Unexpected error invoking function', 'FunctionsError', {\n requestId: 'abc123',\n})\n```"
}
]
}
]
},
"children": [
{
"id": 48,
"name": "constructor",
"variant": "declaration",
"kind": 512,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 32,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L32"
}
],
"signatures": [
{
"id": 49,
"name": "FunctionsError",
"variant": "signature",
"kind": 16384,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 32,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L32"
}
],
"parameters": [
{
"id": 50,
"name": "message",
"variant": "param",
"kind": 32768,
"flags": {},
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"id": 51,
"name": "name",
"variant": "param",
"kind": 32768,
"flags": {},
"type": {
"type": "intrinsic",
"name": "string"
},
"defaultValue": "'FunctionsError'"
},
{
"id": 52,
"name": "context",
"variant": "param",
"kind": 32768,
"flags": {
"isOptional": true
},
"type": {
"type": "intrinsic",
"name": "any"
}
}
],
"type": {
"type": "reference",
"target": 47,
"name": "FunctionsError",
"package": "@supabase/functions-js"
},
"overwrites": {
"type": "reference",
"target": -1,
"name": "Error.constructor"
}
}
],
"overwrites": {
"type": "reference",
"target": -1,
"name": "Error.constructor"
}
},
{
"id": 53,
"name": "context",
"variant": "declaration",
"kind": 1024,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 31,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L31"
}
],
"type": {
"type": "intrinsic",
"name": "any"
}
},
{
"id": 54,
"name": "toJSON",
"variant": "declaration",
"kind": 2048,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"signatures": [
{
"id": 55,
"name": "toJSON",
"variant": "signature",
"kind": 4096,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "reflection",
"declaration": {
"id": 56,
"name": "__type",
"variant": "declaration",
"kind": 65536,
"flags": {},
"children": [
{
"id": 59,
"name": "context",
"variant": "declaration",
"kind": 1024,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 45,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "intrinsic",
"name": "any"
}
},
{
"id": 58,
"name": "message",
"variant": "declaration",
"kind": 1024,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 28,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"id": 57,
"name": "name",
"variant": "declaration",
"kind": 1024,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 14,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"groups": [
{
"title": "Properties",
"children": [59, 58, 57]
}
],
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 12,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
]
}
}
}
]
}
],
"groups": [
{
"title": "Constructors",
"children": [48]
},
{
"title": "Properties",
"children": [53]
},
{
"title": "Methods",
"children": [54]
}
],
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 30,
"character": 13,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L30"
}
],
"extendedTypes": [
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Error"
},
"name": "Error",
"package": "typescript"
}
],
"extendedBy": [
{
"type": "reference",
"target": 60,
"name": "FunctionsFetchError"
},
{
"type": "reference",
"target": 71,
"name": "FunctionsHttpError"
},
{
"type": "reference",
"target": 82,
"name": "FunctionsRelayError"
}
]
},
{
"id": 60,
"name": "FunctionsFetchError",
"variant": "declaration",
"kind": 128,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "Error thrown when the network request to an Edge Function fails."
}
],
"blockTags": [
{
"tag": "@example",
"content": [
{
"kind": "code",
"text": "```ts\nimport { FunctionsFetchError } from '@supabase/functions-js'\n\nthrow new FunctionsFetchError({ requestId: 'abc123' })\n```"
}
]
}
]
},
"children": [
{
"id": 61,
"name": "constructor",
"variant": "declaration",
"kind": 512,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 58,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L58"
}
],
"signatures": [
{
"id": 62,
"name": "FunctionsFetchError",
"variant": "signature",
"kind": 16384,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 58,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L58"
}
],
"parameters": [
{
"id": 63,
"name": "context",
"variant": "param",
"kind": 32768,
"flags": {},
"type": {
"type": "intrinsic",
"name": "any"
}
}
],
"type": {
"type": "reference",
"target": 60,
"name": "FunctionsFetchError",
"package": "@supabase/functions-js"
},
"overwrites": {
"type": "reference",
"target": 49,
"name": "FunctionsError.constructor"
}
}
],
"overwrites": {
"type": "reference",
"target": 48,
"name": "FunctionsError.constructor"
}
},
{
"id": 64,
"name": "context",
"variant": "declaration",
"kind": 1024,
"flags": {
"isInherited": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 31,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L31"
}
],
"type": {
"type": "intrinsic",
"name": "any"
},
"inheritedFrom": {
"type": "reference",
"target": 53,
"name": "FunctionsError.context"
}
},
{
"id": 65,
"name": "toJSON",
"variant": "declaration",
"kind": 2048,
"flags": {
"isInherited": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"signatures": [
{
"id": 66,
"name": "toJSON",
"variant": "signature",
"kind": 4096,
"flags": {
"isInherited": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "reflection",
"declaration": {
"id": 67,
"name": "__type",
"variant": "declaration",
"kind": 65536,
"flags": {},
"children": [
{
"id": 70,
"name": "context",
"variant": "declaration",
"kind": 1024,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 45,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "intrinsic",
"name": "any"
}
},
{
"id": 69,
"name": "message",
"variant": "declaration",
"kind": 1024,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 28,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"id": 68,
"name": "name",
"variant": "declaration",
"kind": 1024,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 14,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"groups": [
{
"title": "Properties",
"children": [70, 69, 68]
}
],
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 12,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
]
}
},
"inheritedFrom": {
"type": "reference",
"target": 55,
"name": "FunctionsError.toJSON"
}
}
],
"inheritedFrom": {
"type": "reference",
"target": 54,
"name": "FunctionsError.toJSON"
}
}
],
"groups": [
{
"title": "Constructors",
"children": [61]
},
{
"title": "Properties",
"children": [64]
},
{
"title": "Methods",
"children": [65]
}
],
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 57,
"character": 13,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L57"
}
],
"extendedTypes": [
{
"type": "reference",
"target": 47,
"name": "FunctionsError",
"package": "@supabase/functions-js"
}
]
},
{
"id": 71,
"name": "FunctionsHttpError",
"variant": "declaration",
"kind": 128,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "Error thrown when the Edge Function returns a non-2xx status code."
}
],
"blockTags": [
{
"tag": "@example",
"content": [
{
"kind": "code",
"text": "```ts\nimport { FunctionsHttpError } from '@supabase/functions-js'\n\nthrow new FunctionsHttpError({ status: 500 })\n```"
}
]
}
]
},
"children": [
{
"id": 72,
"name": "constructor",
"variant": "declaration",
"kind": 512,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 90,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L90"
}
],
"signatures": [
{
"id": 73,
"name": "FunctionsHttpError",
"variant": "signature",
"kind": 16384,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 90,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L90"
}
],
"parameters": [
{
"id": 74,
"name": "context",
"variant": "param",
"kind": 32768,
"flags": {},
"type": {
"type": "intrinsic",
"name": "any"
}
}
],
"type": {
"type": "reference",
"target": 71,
"name": "FunctionsHttpError",
"package": "@supabase/functions-js"
},
"overwrites": {
"type": "reference",
"target": 49,
"name": "FunctionsError.constructor"
}
}
],
"overwrites": {
"type": "reference",
"target": 48,
"name": "FunctionsError.constructor"
}
},
{
"id": 75,
"name": "context",
"variant": "declaration",
"kind": 1024,
"flags": {
"isInherited": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 31,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L31"
}
],
"type": {
"type": "intrinsic",
"name": "any"
},
"inheritedFrom": {
"type": "reference",
"target": 53,
"name": "FunctionsError.context"
}
},
{
"id": 76,
"name": "toJSON",
"variant": "declaration",
"kind": 2048,
"flags": {
"isInherited": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"signatures": [
{
"id": 77,
"name": "toJSON",
"variant": "signature",
"kind": 4096,
"flags": {
"isInherited": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "reflection",
"declaration": {
"id": 78,
"name": "__type",
"variant": "declaration",
"kind": 65536,
"flags": {},
"children": [
{
"id": 81,
"name": "context",
"variant": "declaration",
"kind": 1024,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 45,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "intrinsic",
"name": "any"
}
},
{
"id": 80,
"name": "message",
"variant": "declaration",
"kind": 1024,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 28,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"id": 79,
"name": "name",
"variant": "declaration",
"kind": 1024,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 14,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"groups": [
{
"title": "Properties",
"children": [81, 80, 79]
}
],
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 12,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
]
}
},
"inheritedFrom": {
"type": "reference",
"target": 55,
"name": "FunctionsError.toJSON"
}
}
],
"inheritedFrom": {
"type": "reference",
"target": 54,
"name": "FunctionsError.toJSON"
}
}
],
"groups": [
{
"title": "Constructors",
"children": [72]
},
{
"title": "Properties",
"children": [75]
},
{
"title": "Methods",
"children": [76]
}
],
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 89,
"character": 13,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L89"
}
],
"extendedTypes": [
{
"type": "reference",
"target": 47,
"name": "FunctionsError",
"package": "@supabase/functions-js"
}
]
},
{
"id": 82,
"name": "FunctionsRelayError",
"variant": "declaration",
"kind": 128,
"flags": {},
"comment": {
"summary": [
{
"kind": "text",
"text": "Error thrown when the Supabase relay cannot reach the Edge Function."
}
],
"blockTags": [
{
"tag": "@example",
"content": [
{
"kind": "code",
"text": "```ts\nimport { FunctionsRelayError } from '@supabase/functions-js'\n\nthrow new FunctionsRelayError({ region: 'us-east-1' })\n```"
}
]
}
]
},
"children": [
{
"id": 83,
"name": "constructor",
"variant": "declaration",
"kind": 512,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 74,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L74"
}
],
"signatures": [
{
"id": 84,
"name": "FunctionsRelayError",
"variant": "signature",
"kind": 16384,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 74,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L74"
}
],
"parameters": [
{
"id": 85,
"name": "context",
"variant": "param",
"kind": 32768,
"flags": {},
"type": {
"type": "intrinsic",
"name": "any"
}
}
],
"type": {
"type": "reference",
"target": 82,
"name": "FunctionsRelayError",
"package": "@supabase/functions-js"
},
"overwrites": {
"type": "reference",
"target": 49,
"name": "FunctionsError.constructor"
}
}
],
"overwrites": {
"type": "reference",
"target": 48,
"name": "FunctionsError.constructor"
}
},
{
"id": 86,
"name": "context",
"variant": "declaration",
"kind": 1024,
"flags": {
"isInherited": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 31,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L31"
}
],
"type": {
"type": "intrinsic",
"name": "any"
},
"inheritedFrom": {
"type": "reference",
"target": 53,
"name": "FunctionsError.context"
}
},
{
"id": 87,
"name": "toJSON",
"variant": "declaration",
"kind": 2048,
"flags": {
"isInherited": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"signatures": [
{
"id": 88,
"name": "toJSON",
"variant": "signature",
"kind": 4096,
"flags": {
"isInherited": true
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "reflection",
"declaration": {
"id": 89,
"name": "__type",
"variant": "declaration",
"kind": 65536,
"flags": {},
"children": [
{
"id": 92,
"name": "context",
"variant": "declaration",
"kind": 1024,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 45,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "intrinsic",
"name": "any"
}
},
{
"id": 91,
"name": "message",
"variant": "declaration",
"kind": 1024,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 28,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "intrinsic",
"name": "string"
}
},
{
"id": 90,
"name": "name",
"variant": "declaration",
"kind": 1024,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 14,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
],
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"groups": [
{
"title": "Properties",
"children": [92, 91, 90]
}
],
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 38,
"character": 12,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L38"
}
]
}
},
"inheritedFrom": {
"type": "reference",
"target": 55,
"name": "FunctionsError.toJSON"
}
}
],
"inheritedFrom": {
"type": "reference",
"target": 54,
"name": "FunctionsError.toJSON"
}
}
],
"groups": [
{
"title": "Constructors",
"children": [83]
},
{
"title": "Properties",
"children": [86]
},
{
"title": "Methods",
"children": [87]
}
],
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 73,
"character": 13,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L73"
}
],
"extendedTypes": [
{
"type": "reference",
"target": 47,
"name": "FunctionsError",
"package": "@supabase/functions-js"
}
]
},
{
"id": 36,
"name": "FunctionInvokeOptions",
"variant": "declaration",
"kind": 2097152,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 113,
"character": 12,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L113"
}
],
"type": {
"type": "reflection",
"declaration": {
"id": 37,
"name": "__type",
"variant": "declaration",
"kind": 65536,
"flags": {},
"children": [
{
"id": 44,
"name": "body",
"variant": "declaration",
"kind": 1024,
"flags": {
"isOptional": true
},
"comment": {
"summary": [
{
"kind": "text",
"text": "The body of the request."
}
]
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 129,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L129"
}
],
"type": {
"type": "union",
"types": [
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "File"
},
"name": "File",
"package": "typescript"
},
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "Blob"
},
"name": "Blob",
"package": "typescript"
},
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "ArrayBuffer"
},
"name": "ArrayBuffer",
"package": "typescript"
},
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "FormData"
},
"name": "FormData",
"package": "typescript"
},
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "ReadableStream"
},
"typeArguments": [
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Uint8Array"
},
"name": "Uint8Array",
"package": "typescript"
}
],
"name": "ReadableStream",
"package": "typescript"
},
{
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.es5.d.ts",
"qualifiedName": "Record"
},
"typeArguments": [
{
"type": "intrinsic",
"name": "string"
},
{
"type": "intrinsic",
"name": "any"
}
],
"name": "Record",
"package": "typescript"
},
{
"type": "intrinsic",
"name": "string"
}
]
}
},
{
"id": 38,
"name": "headers",
"variant": "declaration",
"kind": 1024,
"flags": {
"isOptional": true
},
"comment": {
"summary": [
{
"kind": "text",
"text": "Object representing the headers to send with the request."
}
]
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 117,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L117"
}
],
"type": {
"type": "reflection",
"declaration": {
"id": 39,
"name": "__type",
"variant": "declaration",
"kind": 65536,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 117,
"character": 12,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L117"
}
],
"indexSignatures": [
{
"id": 40,
"name": "__index",
"variant": "signature",
"kind": 8192,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 117,
"character": 14,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L117"
}
],
"parameters": [
{
"id": 41,
"name": "key",
"variant": "param",
"kind": 32768,
"flags": {},
"type": {
"type": "intrinsic",
"name": "string"
}
}
],
"type": {
"type": "intrinsic",
"name": "string"
}
}
]
}
}
},
{
"id": 42,
"name": "method",
"variant": "declaration",
"kind": 1024,
"flags": {
"isOptional": true
},
"comment": {
"summary": [
{
"kind": "text",
"text": "The HTTP verb of the request"
}
]
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 121,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L121"
}
],
"type": {
"type": "union",
"types": [
{
"type": "literal",
"value": "POST"
},
{
"type": "literal",
"value": "GET"
},
{
"type": "literal",
"value": "PUT"
},
{
"type": "literal",
"value": "PATCH"
},
{
"type": "literal",
"value": "DELETE"
}
]
}
},
{
"id": 43,
"name": "region",
"variant": "declaration",
"kind": 1024,
"flags": {
"isOptional": true
},
"comment": {
"summary": [
{
"kind": "text",
"text": "The Region to invoke the function in."
}
]
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 125,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L125"
}
],
"type": {
"type": "reference",
"target": 93,
"name": "FunctionRegion",
"package": "@supabase/functions-js"
}
},
{
"id": 45,
"name": "signal",
"variant": "declaration",
"kind": 1024,
"flags": {
"isOptional": true
},
"comment": {
"summary": [
{
"kind": "text",
"text": "The AbortSignal to use for the request."
}
]
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 140,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L140"
}
],
"type": {
"type": "reference",
"target": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "AbortSignal"
},
"name": "AbortSignal",
"package": "typescript"
}
},
{
"id": 46,
"name": "timeout",
"variant": "declaration",
"kind": 1024,
"flags": {
"isOptional": true
},
"comment": {
"summary": [
{
"kind": "text",
"text": "The timeout for the request in milliseconds.\nIf the function takes longer than this, the request will be aborted."
}
]
},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 145,
"character": 2,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L145"
}
],
"type": {
"type": "intrinsic",
"name": "number"
}
}
],
"groups": [
{
"title": "Properties",
"children": [44, 38, 42, 43, 45, 46]
}
],
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 113,
"character": 36,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L113"
}
]
}
}
},
{
"id": 109,
"name": "FunctionsResponse",
"variant": "declaration",
"kind": 2097152,
"flags": {},
"sources": [
{
"fileName": "packages/core/functions-js/src/types.ts",
"line": 16,
"character": 12,
"url": "https://github.com/supabase/supabase-js/blob/84a729bdd73e808f5158b4e1ec07bc14af42c1ae/packages/core/functions-js/src/types.ts#L16"
}
],
"typeParameters": [
{
"id": 110,
"name": "T",
"variant": "typeParam",
"kind": 131072,
"flags": {}
}
],
"type": {
"type": "union",
"types": [
{
"type": "reference",
"target": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsResponseSuccess"
},
"typeArguments": [
{
"type": "reference",
"target": 110,
"name": "T",
"package": "@supabase/functions-js",
"refersToTypeParameter": true
}
],
"name": "FunctionsResponseSuccess",
"package": "@supabase/functions-js"
},
{
"type": "reference",
"target": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsResponseFailure"
},
"name": "FunctionsResponseFailure",
"package": "@supabase/functions-js"
}
]
}
}
],
"groups": [
{
"title": "Enumerations",
"children": [93]
},
{
"title": "Classes",
"children": [1, 47, 60, 71, 82]
},
{
"title": "Type Aliases",
"children": [36, 109]
}
],
"packageName": "@supabase/functions-js",
"readme": [
{
"kind": "text",
"text": "<br />\n<p align=\"center\">\n <a href=\"https://supabase.io\">\n <picture>\n <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/supabase/supabase/master/packages/common/assets/images/supabase-logo-wordmark--dark.svg\">\n <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/supabase/supabase/master/packages/common/assets/images/supabase-logo-wordmark--light.svg\">\n <img alt=\"Supabase Logo\" width=\"300\" src=\"https://raw.githubusercontent.com/supabase/supabase/master/packages/common/assets/images/logo-preview.jpg\">\n </picture>\n </a>\n\n <h1 align=\"center\">Supabase Functions JS SDK</h1>\n\n <h3 align=\"center\">JavaScript SDK to interact with Supabase Edge Functions.</h3>\n\n <p align=\"center\">\n <a href=\"https://supabase.com/docs/guides/functions\">Guides</a>\n ·\n <a href=\"https://supabase.com/docs/reference/javascript/functions-invoke\">Reference Docs</a>\n ·\n <a href=\"https://supabase.github.io/supabase-js/functions-js/v2/spec.json\">TypeDoc</a>\n </p>\n</p>\n\n<div align=\"center\">\n\n[![Build](https://github.com/supabase/supabase-js/workflows/CI/badge.svg)](https://github.com/supabase/supabase-js/actions?query=branch%3Amaster)\n[![Package](https://img.shields.io/npm/v/@supabase/functions-js)](https://www.npmjs.com/package/@supabase/functions-js)\n[![License: MIT](https://img.shields.io/npm/l/@supabase/supabase-js)](#license)\n[![pkg.pr.new](https://pkg.pr.new/badge/supabase/functions-js)](https://pkg.pr.new/~/supabase/functions-js)\n\n</div>\n\n## Requirements\n\n- **Node.js 20 or later** (Node.js 18 support dropped as of October 31, 2025)\n- For browser support, all modern browsers are supported\n\n> ⚠️ **Node.js 18 Deprecation Notice**\n>\n> Node.js 18 reached end-of-life on April 30, 2025. As announced in [our deprecation notice](https://github.com/orgs/supabase/discussions/37217), support for Node.js 18 was dropped on October 31, 2025.\n\n## Quick Start\n\n### Installation\n\n"
},
{
"kind": "code",
"text": "```bash\nnpm install @supabase/functions-js\n```"
},
{
"kind": "text",
"text": "\n\n### Usage\n\n"
},
{
"kind": "code",
"text": "```js\nimport { FunctionsClient } from '@supabase/functions-js'\n\nconst functionsUrl = 'https://<project_ref>.supabase.co/functions/v1'\nconst publishableKey = '<publishable_key>'\n\nconst functions = new FunctionsClient(functionsUrl, {\n headers: {\n Authorization: `Bearer ${publishableKey}`,\n },\n})\n\n// Invoke a function\nconst { data, error } = await functions.invoke('hello-world', {\n body: { name: 'Functions' },\n})\n```"
},
{
"kind": "text",
"text": "\n\n## Development\n\nThis package is part of the [Supabase JavaScript monorepo](https://github.com/supabase/supabase-js). To work on this package:\n\n### Building\n\n"
},
{
"kind": "code",
"text": "```bash\n# Complete build (from monorepo root)\nnpx nx build functions-js\n\n# Build with watch mode for development\nnpx nx build functions-js --watch\n\n# Individual build targets\nnpx nx build:main functions-js # CommonJS build (dist/main/)\nnpx nx build:module functions-js # ES Modules build (dist/module/)\n\n# Other useful commands\nnpx nx clean functions-js # Clean build artifacts\nnpx nx typecheck functions-js # TypeScript type checking\nnpx nx docs functions-js # Generate documentation\n```"
},
{
"kind": "text",
"text": "\n\n#### Build Outputs\n\n- **CommonJS ("
},
{
"kind": "code",
"text": "`dist/main/`"
},
{
"kind": "text",
"text": ")** - For Node.js environments\n- **ES Modules ("
},
{
"kind": "code",
"text": "`dist/module/`"
},
{
"kind": "text",
"text": ")** - For modern bundlers (Webpack, Vite, Rollup)\n- **TypeScript definitions ("
},
{
"kind": "code",
"text": "`dist/module/index.d.ts`"
},
{
"kind": "text",
"text": ")** - Type definitions for TypeScript projects\n\n### Testing\n\n**Docker Required** for relay tests. The functions-js tests use testcontainers to spin up a Deno relay server for testing Edge Function invocations.\n\n"
},
{
"kind": "code",
"text": "```bash\n# Run all tests (from monorepo root)\nnpx nx test functions-js\n\n# Run tests with coverage report\nnpx nx test functions-js --coverage\n\n# Run tests in watch mode during development\nnpx nx test functions-js --watch\n\n# CI test command (runs with coverage)\nnpx nx test:ci functions-js\n```"
},
{
"kind": "text",
"text": "\n\n#### Test Requirements\n\n- **Node.js 20+** - Required for testcontainers\n- **Docker** - Must be installed and running for relay tests\n- No Supabase instance needed - Tests use mocked services and testcontainers\n\n#### What Gets Tested\n\n- **Function invocation** - Testing the "
},
{
"kind": "code",
"text": "`invoke()`"
},
{
"kind": "text",
"text": " method with various options\n- **Relay functionality** - Using a containerized Deno relay to test real Edge Function scenarios\n- **Error handling** - Ensuring proper error responses and retries\n- **Request/response models** - Validating headers, body, and response formats\n\n### Contributing\n\nWe welcome contributions! Please see our [Contributing Guide]("
},
{
"kind": "relative-link",
"text": "../../../CONTRIBUTING.md",
"target": 2
},
{
"kind": "text",
"text": ") for details on how to get started.\n\nFor major changes or if you're unsure about something, please open an issue first to discuss your proposed changes."
}
],
"symbolIdMap": {
"0": {
"sourceFileName": "src/index.ts",
"qualifiedName": ""
},
"1": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "FunctionsClient"
},
"2": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "FunctionsClient.__constructor"
},
"3": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "FunctionsClient"
},
"4": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "url"
},
"5": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "__1"
},
"6": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "__type"
},
"7": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "__type.headers"
},
"8": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "__type.customFetch"
},
"9": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "fetch"
},
"10": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "fetch"
},
"11": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "input"
},
"12": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "init"
},
"13": {
"sourceFileName": "../../../node_modules/@types/node/globals.d.ts",
"qualifiedName": "fetch"
},
"14": {
"sourceFileName": "../../../node_modules/@types/node/globals.d.ts",
"qualifiedName": "input"
},
"15": {
"sourceFileName": "../../../node_modules/@types/node/globals.d.ts",
"qualifiedName": "init"
},
"16": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "__type.region"
},
"17": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "FunctionsClient.url"
},
"18": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "FunctionsClient.headers"
},
"19": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "FunctionsClient.region"
},
"20": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "FunctionsClient.fetch"
},
"21": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "fetch"
},
"22": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "fetch"
},
"23": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "input"
},
"24": {
"sourceFileName": "../../../node_modules/typescript/lib/lib.dom.d.ts",
"qualifiedName": "init"
},
"25": {
"sourceFileName": "../../../node_modules/@types/node/globals.d.ts",
"qualifiedName": "fetch"
},
"26": {
"sourceFileName": "../../../node_modules/@types/node/globals.d.ts",
"qualifiedName": "input"
},
"27": {
"sourceFileName": "../../../node_modules/@types/node/globals.d.ts",
"qualifiedName": "init"
},
"28": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "FunctionsClient.setAuth"
},
"29": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "FunctionsClient.setAuth"
},
"30": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "token"
},
"31": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "FunctionsClient.invoke"
},
"32": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "FunctionsClient.invoke"
},
"33": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "T"
},
"34": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "functionName"
},
"35": {
"sourceFileName": "src/FunctionsClient.ts",
"qualifiedName": "options"
},
"36": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionInvokeOptions"
},
"37": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type"
},
"38": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.headers"
},
"39": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type"
},
"40": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.__index"
},
"42": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.method"
},
"43": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.region"
},
"44": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.body"
},
"45": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.signal"
},
"46": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.timeout"
},
"47": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError"
},
"48": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError.__constructor"
},
"49": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError"
},
"50": {
"sourceFileName": "src/types.ts",
"qualifiedName": "message"
},
"51": {
"sourceFileName": "src/types.ts",
"qualifiedName": "name"
},
"52": {
"sourceFileName": "src/types.ts",
"qualifiedName": "context"
},
"53": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError.context"
},
"54": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError.toJSON"
},
"55": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError.toJSON"
},
"56": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type"
},
"57": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.name"
},
"58": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.message"
},
"59": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.context"
},
"60": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsFetchError"
},
"61": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsFetchError.__constructor"
},
"62": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsFetchError"
},
"63": {
"sourceFileName": "src/types.ts",
"qualifiedName": "context"
},
"64": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError.context"
},
"65": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError.toJSON"
},
"66": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError.toJSON"
},
"67": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type"
},
"68": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.name"
},
"69": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.message"
},
"70": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.context"
},
"71": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsHttpError"
},
"72": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsHttpError.__constructor"
},
"73": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsHttpError"
},
"74": {
"sourceFileName": "src/types.ts",
"qualifiedName": "context"
},
"75": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError.context"
},
"76": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError.toJSON"
},
"77": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError.toJSON"
},
"78": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type"
},
"79": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.name"
},
"80": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.message"
},
"81": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.context"
},
"82": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsRelayError"
},
"83": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsRelayError.__constructor"
},
"84": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsRelayError"
},
"85": {
"sourceFileName": "src/types.ts",
"qualifiedName": "context"
},
"86": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError.context"
},
"87": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError.toJSON"
},
"88": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsError.toJSON"
},
"89": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type"
},
"90": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.name"
},
"91": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.message"
},
"92": {
"sourceFileName": "src/types.ts",
"qualifiedName": "__type.context"
},
"93": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion"
},
"94": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.Any"
},
"95": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.ApNortheast1"
},
"96": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.ApNortheast2"
},
"97": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.ApSouth1"
},
"98": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.ApSoutheast1"
},
"99": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.ApSoutheast2"
},
"100": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.CaCentral1"
},
"101": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.EuCentral1"
},
"102": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.EuWest1"
},
"103": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.EuWest2"
},
"104": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.EuWest3"
},
"105": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.SaEast1"
},
"106": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.UsEast1"
},
"107": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.UsWest1"
},
"108": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionRegion.UsWest2"
},
"109": {
"sourceFileName": "src/types.ts",
"qualifiedName": "FunctionsResponse"
},
"110": {
"sourceFileName": "src/types.ts",
"qualifiedName": "T"
}
},
"files": {
"entries": {
"1": "src/index.ts",
"2": "../../../CONTRIBUTING.md"
},
"reflections": {
"1": 0
}
}
}