Install the TypeScript SDK
How to install a Temporal SDK
A Temporal SDK provides a framework for Temporal Application development.
An SDK provides you with the following:
- A Temporal Client to communicate with a Temporal Service.
- APIs to develop Workflows.
- APIs to create and manage Worker Processes.
- APIs to author Activities.
This project requires Node.js 18 or later.
Create a project
npx @temporalio/create@latest ./your-app
Add to an existing project
npm install @temporalio/client @temporalio/worker @temporalio/workflow @temporalio/activity @temporalio/common
The TypeScript SDK is designed with TypeScript-first developer experience in mind, but it works equally well with JavaScript.
How to find the TypeScript SDK API reference
The Temporal TypeScript SDK API reference is published to typescript.temporal.io.
Where are SDK-specific code examples?
You can find a complete list of executable code samples in Temporal's GitHub repository.
Additionally, several of the Tutorials are backed by a fully executable template application.
Use the TypeScript samples library stored on GitHub to demonstrate various capabilities of Temporal.
Where can I find video demos?
Temporal TypeScript YouTube playlist.
How to import an ECMAScript module
The JavaScript ecosystem is quickly moving toward publishing ECMAScript modules (ESM) instead of CommonJS modules. For
example, node-fetch@3 is ESM, but node-fetch@2 is CommonJS.
For more information about importing a pure ESM dependency, see our Fetch ESM sample for the necessary configuration changes:
package.jsonmust have include the"type": "module"attribute.tsconfig.jsonshould output inesnextformat.- Imports must include the
.jsfile extension.
Linting and types in TypeScript
If you started your project with @temporalio/create, you already have our recommended TypeScript and ESLint
configurations.
If you incrementally added Temporal to an existing app, we do recommend setting up linting and types because they help catch bugs well before you ship them to production, and they improve your development feedback loop. Take a look at our recommended .eslintrc file and tweak to suit your needs.