Skip to content

Latest commit

 

History

History
 
 

README.md

logo

project status project stability

Node.js Client SDK

Read this in other languages: 日本語


Example Requirements

  • Node version 14 or higher is required
  • To get started with Momento you will need a Momento Auth Token. You can get one from the Momento Console.

To run any of the examples you will need to install the dependencies once first:

npm install

Running the Basic Example

This example demonstrates a basic set and get from a cache.

# Run example code
MOMENTO_AUTH_TOKEN=<YOUR AUTH TOKEN> npm run basic

Example Code: basic.ts

Running the Advanced Example

This example demonstrates several slightly more advanced concepts, including:

  • creating and listing caches
  • deleting a key
  • issuing multiple concurrent get requests
  • using the Middleware API to wrap requests
# Run example code
MOMENTO_AUTH_TOKEN=<YOUR AUTH TOKEN> npm run advanced

Example Code: advanced.ts

Running the Dictionary Example

This example demonstrates how to use the dictionary data type.

# Run example code
MOMENTO_AUTH_TOKEN=<YOUR AUTH TOKEN> npm run dictionary

Example Code: dictionary.ts

If you have questions or need help experimenting further, please reach out to us!