Skip to content
This repository was archived by the owner on Jun 10, 2026. It is now read-only.

Rewrite Node SDK

rewritetoday, the official Node.js/TypeScript SDK for the Rewrite API.

It wraps authentication, typed REST calls, and resource helpers on top of @rewritetoday/rest and @rewritetoday/types.

Rewrite Banner

Installation

Use your preferred package manager:

bun add rewritetoday
# Or
npm install rewritetoday
# Or
pnpm add rewritetoday

Setup

First, you need to create an API key in the Rewrite Dashboard and use it in the constructor.

import{Rewrite}from'rewritetoday';constrewrite=newRewrite(process.env.REWRITE_API_KEY);

Create the client

You can pass the API key directly or use the full options object.

import{Rewrite}from'rewritetoday';constrewrite=newRewrite({secret: process.env.REWRITE_API_KEY,rest: {timeout: 10_000,headers: {'User-Agent': 'GetMonitor API (1.0.0)',},},});

Send your first message

const{ data, error }=awaitrewrite.messages.send({to: '+551234567890',content: 'Hey, Rewrite is here!',});

You can view in our documentation everything in you can use when sending a message.

Error Handling

Requests run through @rewritetoday/rest. HTTP failures can throw HTTPError.

import{HTTPError}from'@rewritetoday/rest';try{awaitrewrite.messages.get('invalid_id');}catch(error){if(errorinstanceofHTTPError){console.error('HTTP Error:',error.status,error.method,error.url);}}

Made with 🤍 by the Rewrite team.
SMS the way it should be.

About

Rewrite's official Node.js SDK

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages