The Membrane JavaScript SDK provides typed accessors for all Membrane resources. It works in both Node.js and browser environments.
Install
npm install @membranehq/sdk
Initialize
import { MembraneClient } from '@membranehq/sdk'// With a static tokenconst membrane = new MembraneClient({ token: process.env.MEMBRANE_ACCESS_TOKEN,})// With dynamic token fetching — for long-lived environments (like web pages)// where the token may expire and needs to be refreshedconst membrane = new MembraneClient({ fetchToken: async () => { const response = await fetch('/api/membrane-token') const { token } = await response.json() return token },})
// List integrationsconst integrations = await membrane.integrations.find()// Get a specific connectionconst connection = await membrane.connection('hubspot').get()// Run an actionconst result = await membrane.action('create-contact').run({ email: 'jane@example.com', name: 'Jane',})// Open connection UIawait membrane.ui.connect({ integrationKey: 'salesforce' })
SDK Reference
See the SDK Reference for the full list of accessors, methods, and types.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Membrane Docs","colors":{"primary":"#0F766E","light":"#14B8A6","dark":"#115E59"},"logo":{"light":"https://mintcdn.com/membrane/gm3Y_siK8MKZ6tLX/logo/light.svg?fit=max\u0026auto=format\u0026n=gm3Y_siK8MKZ6tLX\u0026q=85\u0026s=9860802d10568fa12d594369f424bd53","dark":"https://mintcdn.com/membrane/gm3Y_siK8MKZ6tLX/logo/dark.svg?fit=max\u0026auto=format\u0026n=gm3Y_siK8MKZ6tLX\u0026q=85\u0026s=af5a07ba7603b3bf5a71b8fd902fce5c"},"favicon":"https://mintcdn.com/membrane/gm3Y_siK8MKZ6tLX/favicon.svg?fit=max\u0026auto=format\u0026n=gm3Y_siK8MKZ6tLX\u0026q=85\u0026s=ae91902583ef1b67627012d6a3fa9069","api":{"playground":{"display":"interactive","proxy":false}},"navbar":{"links":[{"href":"https://changelog.getmembrane.com","label":"Changelog"}],"primary":{"type":"button","label":"Website","href":"https://getmembrane.com"}},"footer":{"socials":{"github":"https://github.com/membranehq"}},"icons":{"library":"fontawesome"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"membrane","hasAudioNarration":false,"actualSubdomain":"membrane","customDomains":["docs.getmembrane.com"],"gitSource":{"type":"github","owner":"membranehq","repo":"core","deployBranch":"main","contentDirectory":"docs/mintlify","isPrivate":true,"mountPath":"","label":""},"feedback":{"agentFeedback":true,"thumbs":true},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6b047905abd05fc464a8f531","clientVersion":"0.0.4377","searchFilterCounts":[{"language":"default","tag":"Reference","count":317},{"language":"default","tag":"Workspace Elements","count":303},{"language":"default","tag":"Guides","count":82},{"language":"default","tag":"Connectors","count":34},{"language":"default","tag":"Data Collections","count":32},{"language":"default","tag":"References","count":21},{"language":"default","tag":"Internal Events","count":21},{"language":"default","tag":"Flows","count":21},{"language":"default","tag":"Managing Membrane","count":20},{"language":"default","tag":"Ways to Use Membrane","count":19}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"docs/ways-to-use-membrane/sdk","slug":"/docs/ways-to-use-membrane/sdk","pageMetadata":{"title":"JavaScript SDK","description":null,"href":"/docs/ways-to-use-membrane/sdk"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`The Membrane JavaScript SDK provides typed accessors for all Membrane resources. It works in both Node.js and browser environments.`}),`\n`,_jsx(Heading,{level:`2`,id:`install`,children:`Install`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npm`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` install`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @membranehq/sdk`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`initialize`,children:`Initialize`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`MembraneClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '@membranehq/sdk'`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// With a static token`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` membrane`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` MembraneClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` token:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` process`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`env`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`MEMBRANE_ACCESS_TOKEN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// With dynamic token fetching — for long-lived environments (like web pages)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// where the token may expire and needs to be refreshed`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` membrane`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` MembraneClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetchToken`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` () `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'/api/membrane-token'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`token`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` token`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/docs/how-membrane-works/authentication`,children:`Authentication`}),` for how to get an access token.`]}),`\n`,_jsx(Heading,{level:`2`,id:`usage`,children:`Usage`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// List integrations`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` integrations`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` membrane`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`integrations`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`find`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Get a specific connection`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` connection`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` membrane`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`connection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'hubspot'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Run an action`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` result`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` membrane`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`action`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'create-contact'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`run`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` email:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'jane@example.com'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` name:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Jane'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Open connection UI`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` membrane`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ui`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`connect`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({ `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`integrationKey:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'salesforce'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`sdk-reference`,children:`SDK Reference`}),`\n`,_jsxs(_components.p,{children:[`See the `,_jsx(_components.a,{href:`https://console.getmembrane.com/ref/sdk/index.html`,children:`SDK Reference`}),` for the full list of accessors, methods, and types.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"JavaScript SDK","description":null,"href":"/docs/ways-to-use-membrane/sdk"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Install","slug":"install","depth":2,"children":[]},{"title":"Initialize","slug":"initialize","depth":2,"children":[]},{"title":"Usage","slug":"usage","depth":2,"children":[]},{"title":"SDK Reference","slug":"sdk-reference","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"membrane","siteName":"Membrane Docs","title":"JavaScript SDK - Membrane Docs","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-04T10:24:23.420Z","originalFileLocation":"docs/ways-to-use-membrane/sdk.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Membrane Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/membrane/wjnKNX39rmgaozZK/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/membrane/wjnKNX39rmgaozZK/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/membrane/wjnKNX39rmgaozZK/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/membrane/wjnKNX39rmgaozZK/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/membrane/wjnKNX39rmgaozZK/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/membrane/wjnKNX39rmgaozZK/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/membrane/wjnKNX39rmgaozZK/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/membrane/wjnKNX39rmgaozZK/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/membrane/wjnKNX39rmgaozZK/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"JavaScript SDK - Membrane Docs\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Membrane Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.getmembrane.com/docs/ways-to-use-membrane/sdk\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://membrane.mintlify.site/_mintlify/api/og/v2?division=Documentation\u0026amp;title=JavaScript+SDK\u0026amp;theme=1b4e64e36d0001d45e9f7a85\u0026amp;signature=18195066ff5d1245ba65a8706267684704b1f9962d3657c15c0a6767a6515810\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"JavaScript SDK - Membrane Docs\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://membrane.mintlify.site/_mintlify/api/og/v2?division=Documentation\u0026amp;title=JavaScript+SDK\u0026amp;theme=1b4e64e36d0001d45e9f7a85\u0026amp;signature=18195066ff5d1245ba65a8706267684704b1f9962d3657c15c0a6767a6515810\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/membrane/wjnKNX39rmgaozZK/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Membrane Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0F766E\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.getmembrane.com/docs/ways-to-use-membrane/sdk\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/ways-to-use-membrane/sdk.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.getmembrane.com/#organization\",\"name\":\"Membrane Docs\",\"url\":\"https://docs.getmembrane.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/membrane/gm3Y_siK8MKZ6tLX/logo/light.svg?fit=max\u0026auto=format\u0026n=gm3Y_siK8MKZ6tLX\u0026q=85\u0026s=9860802d10568fa12d594369f424bd53\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.getmembrane.com#website\",\"name\":\"Membrane Docs\",\"url\":\"https://docs.getmembrane.com\",\"publisher\":{\"@id\":\"https://docs.getmembrane.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.getmembrane.com/docs/ways-to-use-membrane/sdk#webpage\",\"url\":\"https://docs.getmembrane.com/docs/ways-to-use-membrane/sdk\",\"name\":\"JavaScript SDK\",\"dateModified\":\"2026-11-04T10:24:23.420Z\",\"isPartOf\":{\"@id\":\"https://docs.getmembrane.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.getmembrane.com/docs/ways-to-use-membrane/sdk#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.getmembrane.com/docs/ways-to-use-membrane/sdk#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ways to Use Membrane\",\"item\":\"https://docs.getmembrane.com/docs/ways-to-use-membrane/agent-skills\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript SDK\",\"item\":\"https://docs.getmembrane.com/docs/ways-to-use-membrane/sdk\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.getmembrane.com/docs/ways-to-use-membrane/sdk#article\",\"headline\":\"JavaScript SDK\",\"name\":\"JavaScript SDK\",\"url\":\"https://docs.getmembrane.com/docs/ways-to-use-membrane/sdk\",\"mainEntityOfPage\":{\"@id\":\"https://docs.getmembrane.com/docs/ways-to-use-membrane/sdk#webpage\"},\"dateModified\":\"2026-11-04T10:24:23.420Z\",\"publisher\":{\"@id\":\"https://docs.getmembrane.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.getmembrane.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Membrane Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Membrane Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/ways-to-use-membrane/sdk.md","siteName":"Membrane Docs","nav":{"global":null,"tabs":[{"tab":"Guides","groups":[{"group":"Getting Started","pages":[{"title":"Overview","href":"/docs/getting-started/overview"},{"title":"Quickstart: AI Agents","href":"/docs/getting-started/quickstart-agent"},{"group":"Quickstart: Product Integrations","root":{"title":"Quickstart: Product Integrations","href":"/docs/getting-started/product-integrations"},"pages":[{"title":"Integration Catalog","href":"/docs/getting-started/product-integrations/integration-catalog"},{"title":"In-app AI Agent","href":"/docs/getting-started/product-integrations/in-app-ai-agent"},{"title":"In-app Workflow Builder","href":"/docs/getting-started/product-integrations/in-app-workflow-builder"},{"group":"Data Integrations","root":{"title":"Data Integrations","href":"/docs/getting-started/product-integrations/data-integrations"},"pages":[{"title":"Continuous Data Import","href":"/docs/getting-started/product-integrations/data-integrations/continuous-data-import"},{"title":"Pushing Data to External Apps","href":"/docs/getting-started/product-integrations/data-integrations/pushing-data-to-external-apps"},{"title":"Bi-directional Data Sync","href":"/docs/getting-started/product-integrations/data-integrations/bi-directional-data-sync"},{"title":"Import User-selected Data Collections","href":"/docs/getting-started/product-integrations/data-integrations/import-user-selected-data-collections"}]}]}]},{"group":"Ways to Use Membrane","pages":[{"title":"Agent Skills","href":"/docs/ways-to-use-membrane/agent-skills"},{"title":"CLI","href":"/docs/ways-to-use-membrane/cli"},{"title":"REST API","description":null,"href":"/docs/ways-to-use-membrane/rest-api"},{"group":"JavaScript SDK","root":{"title":"JavaScript SDK","href":"/docs/ways-to-use-membrane/sdk"},"pages":[{"group":"React SDK","root":{"title":"React SDK","description":null,"href":"/docs/ways-to-use-membrane/sdk/react"},"pages":[{"title":"Hooks","description":null,"href":"/docs/ways-to-use-membrane/sdk/react/hooks"},{"title":"UI Components","description":null,"href":"/docs/ways-to-use-membrane/sdk/react/ui-components"},{"title":"Data Input","description":null,"href":"/docs/ways-to-use-membrane/sdk/react/data-input"},{"title":"Combobox","description":null,"href":"/docs/ways-to-use-membrane/sdk/react/combobox"},{"title":"Portal Boundary","description":null,"href":"/docs/ways-to-use-membrane/sdk/react/portal-boundary"}]},{"group":"Vue.js","root":{"title":"Vue.js","href":"/docs/ways-to-use-membrane/sdk/vue"},"pages":[]},{"title":"CSP Rules","description":null,"href":"/docs/ways-to-use-membrane/sdk/csp-rules"}]},{"title":"MCP","href":"/docs/ways-to-use-membrane/mcp"},{"group":"Embedded UI","root":{"title":"Embedded UI","href":"/docs/ways-to-use-membrane/embedded-ui"},"pages":[{"group":"Connection UI","root":{"title":"Connection UI","href":"/docs/ways-to-use-membrane/embedded-ui/connection-ui"},"pages":[{"title":"Custom Connection UI","href":"/docs/ways-to-use-membrane/embedded-ui/connection-ui/custom-connection-ui"},{"title":"Connection UI Without the Front-End SDK","href":"/docs/ways-to-use-membrane/embedded-ui/connection-ui/connection-ui-without-the-front-end-sdk"},{"title":"Custom Connector Parameters","href":"/docs/ways-to-use-membrane/embedded-ui/connection-ui/custom-connector-parameters"}]}]},{"title":"Console","href":"/docs/ways-to-use-membrane/console"}]},{"group":"How Membrane Works","pages":[{"title":"Authentication","href":"/docs/how-membrane-works/authentication"},{"group":"Connections","root":{"title":"Connections","href":"/docs/how-membrane-works/connections"},"pages":[{"title":"API Proxy","href":"/docs/how-membrane-works/connections/api-proxy"}]},{"title":"Actions","href":"/docs/how-membrane-works/actions"},{"title":"Events","href":"/docs/how-membrane-works/events"},{"title":"Tenants","href":"/docs/how-membrane-works/tenants"},{"title":"Internal API","href":"/docs/how-membrane-works/internal-api"},{"title":"Binary Data and Files","href":"/docs/how-membrane-works/binary-data-and-files"},{"title":"Membrane Universe","href":"/docs/how-membrane-works/membrane-universe"}]},{"group":"Managing Membrane","pages":[{"group":"Monitoring and Troubleshooting","root":{"title":"Monitoring and Troubleshooting","href":"/docs/managing-membrane/monitoring-troubleshooting"},"pages":[{"group":"Logs","root":{"title":"Logs","href":"/docs/managing-membrane/monitoring-troubleshooting/logs"},"pages":[{"title":"API Requests","href":"/docs/managing-membrane/monitoring-troubleshooting/logs/api-requests"},{"title":"External Event Pulls","href":"/docs/managing-membrane/monitoring-troubleshooting/logs/external-event-pulls"},{"title":"External Events","href":"/docs/managing-membrane/monitoring-troubleshooting/logs/external-events"},{"title":"External Webhooks","href":"/docs/managing-membrane/monitoring-troubleshooting/logs/external-webhooks"},{"title":"Flow Runs","href":"/docs/managing-membrane/monitoring-troubleshooting/logs/flow-runs"},{"title":"Internal Events","href":"/docs/managing-membrane/monitoring-troubleshooting/logs/internal-events"}]},{"title":"Webhook Notifications","href":"/docs/managing-membrane/monitoring-troubleshooting/webhook-notifications"}]},{"group":"Self Hosting","root":{"title":"Self Hosting","href":"/docs/managing-membrane/self-hosting"},"pages":[{"title":"AWS","href":"/docs/managing-membrane/self-hosting/aws"},{"title":"Azure","href":"/docs/managing-membrane/self-hosting/azure"},{"title":"Google Cloud Platform","href":"/docs/managing-membrane/self-hosting/google-cloud-platform"},{"title":"Helm","href":"/docs/managing-membrane/self-hosting/helm"},{"title":"System Webhooks","href":"/docs/managing-membrane/self-hosting/system-webhooks"},{"title":"Connection Credentials Storage","href":"/docs/managing-membrane/self-hosting/connection-credentials-storage"},{"title":"Self-hosted Universe","href":"/docs/managing-membrane/self-hosting/self-hosted-universe"}]},{"title":"Import and Export","href":"/docs/managing-membrane/import-and-export"},{"title":"Limits","href":"/docs/managing-membrane/limits"},{"title":"Security and Privacy","href":"/docs/managing-membrane/security-and-privacy"}]},{"group":"References","pages":[{"group":"Functions","root":{"title":"Functions","href":"/docs/references/functions"},"pages":[{"group":"Function Types","root":{"title":"Function Types","href":"/docs/references/functions/function-types"},"pages":[{"title":"JavaScript","href":"/docs/references/functions/function-types/javascript"},{"title":"Mapping","href":"/docs/references/functions/function-types/mapping"},{"title":"REST API Mapping","href":"/docs/references/functions/function-types/rest-api-mapping"},{"title":"GraphQL API Mapping","href":"/docs/references/functions/function-types/graphql-api-mapping"},{"title":"API Request to External App","href":"/docs/references/functions/function-types/api-request-to-external-app"},{"title":"API Request to Your App","href":"/docs/references/functions/function-types/api-request-to-your-app"},{"title":"HTTP Request","href":"/docs/references/functions/function-types/http-request"},{"title":"List Data Records","href":"/docs/references/functions/function-types/list-data-records"},{"title":"Find Data Record By ID","href":"/docs/references/functions/function-types/find-data-record-by-id"},{"title":"Search Data Record","href":"/docs/references/functions/function-types/search-data-record"},{"title":"Match Data Record","href":"/docs/references/functions/function-types/match-data-record"},{"title":"Create Data Record","href":"/docs/references/functions/function-types/create-data-record"},{"title":"Update Data Record","href":"/docs/references/functions/function-types/update-data-record"},{"title":"Delete Data Record","href":"/docs/references/functions/function-types/delete-data-record"},{"title":"Run Action","href":"/docs/references/functions/function-types/run-action"}]}]},{"title":"Universal Data Models","href":"/docs/references/universal-data-models-ref"},{"title":"Data Schemas","href":"/docs/references/data-schemas"},{"title":"Formulas","href":"/docs/references/formulas"},{"title":"SDKs","href":"/docs/references/sdks"}]},{"group":"Support","root":{"title":"Support","href":"/docs/support"},"pages":[{"title":"Membrane Expert","href":"/docs/support/membrane-expert"}]}]},{"tab":"Reference","pages":[{"title":"Reference","href":"/reference/overview/authentication"}]}]},"basePath":"","title":"JavaScript SDK - Membrane Docs","deploymentId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","buildId":"dpl_Ab6nteg7kvyK8iL73naC2n7fmsWK","dynamics":[],"chunks":[]}