Follow these steps to set up a TypeScript and Node.js project for interacting with the Bags API.
Before you can follow our TypeScript and Node.js how-to guides, you need to set up your development environment. This guide will walk you through creating a new project, installing essential packages, and configuring your environment.
1. Initialize Your TypeScript Project
First, create a new directory for your project and initialize it:
Also, install the necessary development dependencies:
npm install -D typescript ts-node @types/node
3. Set Up Environment Variables
Create a .env file in your project root to store your Bags API key, Solana RPC URL, and other secrets:
# .envBAGS_API_KEY=your_api_key_hereSOLANA_RPC_URL=https://api.mainnet-beta.solana.com# PRIVATE_KEY=your_base58_encoded_private_key_here # Required for guides that perform transactions
You can get your API key from dev.bags.fm. Some guides might require additional variables like your wallet’s private key for signing transactions.
Never commit your .env file to version control. Add it to your .gitignore file to keep your secrets safe.
4. Project Structure
Your project structure should look like this:
my-bags-project/├── package.json├── tsconfig.json├── .env├── .gitignore└── src/ └── (your TypeScript files will go here)
Make sure to add .env to your .gitignore file:
# .gitignore.envnode_modules/dist/
You are now ready to follow our how-to guides! Each guide will include the complete setup code needed to initialize the SDK and run the examples.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Bags API Documentation","colors":{"primary":"#02FF40","light":"#07C983","dark":"#2764EF"},"logo":{"light":"https://mintcdn.com/bags/RKWqNxf_W11XpLHf/logo/bags-icon-black.png?fit=max\u0026auto=format\u0026n=RKWqNxf_W11XpLHf\u0026q=85\u0026s=69b17952f62b673093120afdb6aef487","dark":"https://mintcdn.com/bags/RKWqNxf_W11XpLHf/logo/bags-icon-white.png?fit=max\u0026auto=format\u0026n=RKWqNxf_W11XpLHf\u0026q=85\u0026s=c48ca310fff068aca2e49aba81f228be"},"favicon":"https://mintcdn.com/bags/w5EkpKbzNJ9_Wl2G/favicon.ico?fit=max\u0026auto=format\u0026n=w5EkpKbzNJ9_Wl2G\u0026q=85\u0026s=90ce97dfa89bfcb8818dad93b7b3b23e","navbar":{"links":[{"href":"https://support.bags.fm","label":"Support"}],"primary":{"type":"button","label":"Get API Key","href":"https://dev.bags.fm"}},"footer":{"socials":{"x":"https://x.com/BagsApp","github":"https://github.com/bagsfm","linkedin":"https://www.linkedin.com/company/bagsfm"}},"contextual":{"options":["chatgpt","cursor","view","claude","perplexity","mcp","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"bags","hasAudioNarration":false,"actualSubdomain":"bags","customDomains":["docs.bags.fm"],"gitSource":{"type":"github","owner":"bagsfm","repo":"bags-public-api-v2-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6af261602f16495db304a4ae","clientVersion":"0.0.4142","searchFilterCounts":[{"language":"default","tag":"API reference","count":82},{"language":"default","tag":"Guides","count":40},{"language":"default","tag":"Robinhood Chain","count":22},{"language":"default","tag":"How-to Guides","count":18},{"language":"default","tag":"Token Launch","count":13},{"language":"default","tag":"Core Principles","count":9},{"language":"default","tag":"BagsPay","count":8},{"language":"default","tag":"Fee Claiming","count":6},{"language":"default","tag":"Fee Share","count":6},{"language":"default","tag":"Analytics","count":6}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"how-to-guides/typescript-node-setup","slug":"/how-to-guides/typescript-node-setup","pageMetadata":{"title":"Set Up a TypeScript \u0026 Node.js Project","description":"Follow these steps to set up a TypeScript and Node.js project for interacting with the Bags API.","og:image":"https://docs.bags.fm/images/og/how-to-guides--typescript-node-setup.png","twitter:image":"https://docs.bags.fm/images/og/how-to-guides--typescript-node-setup.png","href":"/how-to-guides/typescript-node-setup"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Follow these steps to set up a TypeScript and Node.js project for interacting with the Bags API.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"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,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Before you can follow our TypeScript and Node.js how-to guides, you need to set up your development environment. This guide will walk you through creating a new project, installing essential packages, and configuring your environment.`}),`\n`,_jsx(Heading,{level:`2`,id:`1-initialize-your-typescript-project`,children:`1. Initialize Your TypeScript Project`}),`\n`,_jsx(_components.p,{children:`First, create a new directory for your project and initialize it:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,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:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`mkdir`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` my-bags-project`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`cd`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` my-bags-project`})]}),`\n`,_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:` init`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -y`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Next, install TypeScript and initialize the TypeScript configuration:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,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:`2`,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:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -g`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` typescript`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`npx`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` tsc`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --init`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This will create a `,_jsx(_components.code,{children:`tsconfig.json`}),` file with default settings, which you can customize as needed.`]}),`\n`,_jsx(Heading,{level:`2`,id:`2-install-core-dependencies`,children:`2. Install Core Dependencies`}),`\n`,_jsx(_components.p,{children:`Now, install the core dependencies required for most interactions with the Bags API and for running your TypeScript code with Node.js.`}),`\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:` @bagsfm/bags-sdk`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` dotenv`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @solana/web3.js`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` bs58`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Also, install the necessary development dependencies:`}),`\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:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -D`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` typescript`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ts-node`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` @types/node`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`3-set-up-environment-variables`,children:`3. Set Up Environment Variables`}),`\n`,_jsxs(_components.p,{children:[`Create a `,_jsx(_components.code,{children:`.env`}),` file in your project root to store your Bags API key, Solana RPC URL, and other secrets:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,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:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# .env`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`BAGS_API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`your_api_key_here`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`SOLANA_RPC_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`https://api.mainnet-beta.solana.com`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# PRIVATE_KEY=your_base58_encoded_private_key_here # Required for guides that perform transactions`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`You can get your API key from `,_jsx(_components.a,{href:`https://dev.bags.fm`,children:`dev.bags.fm`}),`. Some guides might require additional variables like your wallet’s private key for signing transactions.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Never commit your `,_jsx(_components.code,{children:`.env`}),` file to version control. Add it to your `,_jsx(_components.code,{children:`.gitignore`}),` file to keep your secrets safe.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`4-project-structure`,children:`4. Project Structure`}),`\n`,_jsx(_components.p,{children:`Your project structure should look like this:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`8`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`my-bags-project/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── package.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── tsconfig.json`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── .env`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`├── .gitignore`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`└── src/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:` └── (your TypeScript files will go here)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Make sure to add `,_jsx(_components.code,{children:`.env`}),` to your `,_jsx(_components.code,{children:`.gitignore`}),` file:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,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:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# .gitignore`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`.env`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`node_modules/`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`dist/`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`You are now ready to follow our how-to guides! Each guide will include the complete setup code needed to initialize the SDK and run the examples.`})]})}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":"Set Up a TypeScript \u0026 Node.js Project","description":"Follow these steps to set up a TypeScript and Node.js project for interacting with the Bags API.","og:image":"https://docs.bags.fm/images/og/how-to-guides--typescript-node-setup.png","twitter:image":"https://docs.bags.fm/images/og/how-to-guides--typescript-node-setup.png","href":"/how-to-guides/typescript-node-setup"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"1. Initialize Your TypeScript Project","slug":"1-initialize-your-typescript-project","depth":2,"children":[]},{"title":"2. Install Core Dependencies","slug":"2-install-core-dependencies","depth":2,"children":[]},{"title":"3. Set Up Environment Variables","slug":"3-set-up-environment-variables","depth":2,"children":[]},{"title":"4. Project Structure","slug":"4-project-structure","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/bags/40eef5b427cd9b0f/api-reference/scripts/bundle-openapi.js"],"subdomain":"bags","siteName":"Bags API Documentation","title":"Set Up a TypeScript \u0026 Node.js Project - Bags API Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2025-11-11T05:50:35.643Z","originalFileLocation":"how-to-guides/typescript-node-setup.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=\"description\" content=\"Follow these steps to set up a TypeScript and Node.js project for interacting with the Bags API.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Bags API Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/bags/G7OIIkKXO4sDjQZ2/_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/bags/G7OIIkKXO4sDjQZ2/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/bags/G7OIIkKXO4sDjQZ2/_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/bags/G7OIIkKXO4sDjQZ2/_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/bags/G7OIIkKXO4sDjQZ2/_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/bags/G7OIIkKXO4sDjQZ2/_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/bags/G7OIIkKXO4sDjQZ2/_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/bags/G7OIIkKXO4sDjQZ2/_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/bags/G7OIIkKXO4sDjQZ2/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Set Up a TypeScript \u0026amp; Node.js Project - Bags API Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Follow these steps to set up a TypeScript and Node.js project for interacting with the Bags API.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Bags API Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.bags.fm/how-to-guides/typescript-node-setup\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://docs.bags.fm/images/og/how-to-guides--typescript-node-setup.png\">\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=\"Set Up a TypeScript \u0026amp; Node.js Project - Bags API Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Follow these steps to set up a TypeScript and Node.js project for interacting with the Bags API.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://docs.bags.fm/images/og/how-to-guides--typescript-node-setup.png\">\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/bags/G7OIIkKXO4sDjQZ2/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Bags API Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#02FF40\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.bags.fm/how-to-guides/typescript-node-setup\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/how-to-guides/typescript-node-setup.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.bags.fm/#organization\",\"name\":\"Bags API Documentation\",\"url\":\"https://docs.bags.fm\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/bags/RKWqNxf_W11XpLHf/logo/bags-icon-black.png?fit=max\u0026auto=format\u0026n=RKWqNxf_W11XpLHf\u0026q=85\u0026s=69b17952f62b673093120afdb6aef487\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.bags.fm#website\",\"name\":\"Bags API Documentation\",\"url\":\"https://docs.bags.fm\",\"publisher\":{\"@id\":\"https://docs.bags.fm/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.bags.fm/how-to-guides/typescript-node-setup#webpage\",\"url\":\"https://docs.bags.fm/how-to-guides/typescript-node-setup\",\"name\":\"Set Up a TypeScript \u0026 Node.js Project\",\"description\":\"Follow these steps to set up a TypeScript and Node.js project for interacting with the Bags API.\",\"dateModified\":\"2025-11-11T05:50:35.643Z\",\"isPartOf\":{\"@id\":\"https://docs.bags.fm#website\"},\"breadcrumb\":{\"@id\":\"https://docs.bags.fm/how-to-guides/typescript-node-setup#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.bags.fm/how-to-guides/typescript-node-setup#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Bags API Documentation\",\"item\":\"https://docs.bags.fm\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Set Up a TypeScript \u0026 Node.js Project\",\"item\":\"https://docs.bags.fm/how-to-guides/typescript-node-setup\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.bags.fm/how-to-guides/typescript-node-setup#article\",\"headline\":\"Set Up a TypeScript \u0026 Node.js Project\",\"name\":\"Set Up a TypeScript \u0026 Node.js Project\",\"description\":\"Follow these steps to set up a TypeScript and Node.js project for interacting with the Bags API.\",\"url\":\"https://docs.bags.fm/how-to-guides/typescript-node-setup\",\"mainEntityOfPage\":{\"@id\":\"https://docs.bags.fm/how-to-guides/typescript-node-setup#webpage\"},\"image\":\"https://docs.bags.fm/images/og/how-to-guides--typescript-node-setup.png\",\"dateModified\":\"2025-11-11T05:50:35.643Z\",\"publisher\":{\"@id\":\"https://docs.bags.fm/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.bags.fm#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Bags API Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Bags API Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/how-to-guides/typescript-node-setup.md","siteName":"Bags API Documentation","nav":{"global":{"anchors":[]},"tabs":[{"tab":"Guides","groups":[{"group":"Getting started","pages":[{"title":"Bags API Documentation","href":""}]},{"group":"CLI","pages":[{"title":"Install and Set Up the Bags CLI","href":"/cli/install-and-setup"},{"title":"Quickstart: Launch a Token","href":"/cli/quickstart-token-launch"},{"title":"CLI Command Reference","description":"Complete reference for every Bags CLI command, subcommand, flag, and option","href":"/cli/command-reference"}]},{"group":"How-to Guides","pages":[{"title":"Set Up a TypeScript \u0026 Node.js Project","href":"/how-to-guides/typescript-node-setup"},{"title":"Launch a Token","description":"Complete step-by-step guide to launch a Solana token using the Bags API v2 with TypeScript and Node.js","href":"/how-to-guides/launch-token"},{"title":"Launch a Token with a Custom Quote","href":"/how-to-guides/launch-token-non-sol-quote"},{"title":"Create a Launch Intent URL","href":"/how-to-guides/create-launch-intent"},{"title":"Create Partner Key","href":"/how-to-guides/create-partner-key"},{"title":"Claim Partner Fees","href":"/how-to-guides/claim-partner-fees"},{"title":"Get Token Lifetime Fees","href":"/how-to-guides/get-token-lifetime-fees"},{"title":"Get Token Creators","href":"/how-to-guides/get-token-creators"},{"title":"Claim Token Fees","href":"/how-to-guides/claim-fees"},{"title":"Claim Custom Quote Fees","href":"/how-to-guides/claim-custom-quote-fees"},{"title":"Deployer Fees","href":"/how-to-guides/deployer-fees"},{"title":"Trade Tokens","href":"/how-to-guides/trade-tokens"},{"title":"Initial Buy Math","href":"/how-to-guides/initial-buy-math"},{"title":"Get Token Claim Events","href":"/how-to-guides/get-token-claim-events"},{"title":"Customize Token Fees","href":"/how-to-guides/customize-token-fees"},{"title":"Pay Fees to X Money","href":"/how-to-guides/pay-fees-to-x-money"},{"title":"Track BagsPay Events","href":"/how-to-guides/track-bags-payout-events"},{"title":"Agent Authentication and Skill Workflow","href":"/how-to-guides/agent-authentication"}]},{"group":"Core Principles","pages":[{"title":"Base URL \u0026 Versioning","href":"/principles/base-url-versioning"},{"title":"Program IDs","href":"/principles/program-ids"},{"title":"Address Lookup Tables (LUTs)","href":"/principles/lookup-tables"},{"title":"Transaction Plans","href":"/principles/transaction-plans"},{"title":"Priority Fees and Tips","href":"/principles/tipping"},{"title":"Error Handling","href":"/principles/error-handling"},{"title":"Rate Limits","href":"/principles/rate-limits"},{"title":"File Upload Support","href":"/principles/file-uploads"},{"title":"API Key Management","href":"/principles/api-key-management"}]},{"group":"Robinhood Chain","pages":[{"title":"Robinhood Chain Overview","href":"/robinhood/overview"},{"title":"Environment Setup","href":"/robinhood/setup"}]},{"group":"Robinhood Chain Guides","pages":[{"title":"Launch a Token","href":"/robinhood/launch-token"},{"title":"Trade Tokens","href":"/robinhood/trade-tokens"},{"title":"Read State \u0026 Discover Tokens","href":"/robinhood/read-state"},{"title":"Claim Creator Fees","href":"/robinhood/claim-fees"},{"title":"Launch an Index Token","href":"/robinhood/index-tokens"},{"title":"Partner Program","href":"/robinhood/partner-program"}]},{"group":"Robinhood Chain Reference","pages":[{"title":"Contracts Reference","href":"/robinhood/contracts"}]}]},{"tab":"API reference","pages":[{"title":"API reference","href":"/api-reference/introduction"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/changelog"}]},{"tab":"FAQ","pages":[{"title":"FAQ","href":"/faq/what-is-bags-api"}]}]},"basePath":"","title":"Set Up a TypeScript \u0026 Node.js Project - Bags API Documentation","buildId":"dpl_G2Qd45vZZ7MkBiGF9yYx8ZsbbKXX","deploymentId":"dpl_G2Qd45vZZ7MkBiGF9yYx8ZsbbKXX","dynamics":[],"chunks":[]}