Integrations/Node.js
Language

Create spreadsheets & documents with Node.js

Create a shareable spreadsheet from Node.js in one call using the built-in fetch — no SDK, no Google client library. Send your rows as JSON and get back a URL that opens in any browser. The example below works in Node 18+, serverless functions, and edge runtimes.

Node.js (fetch)
const res = await fetch("https://openofficeai.com/api/v1/sheets", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    title: "Q3 Revenue",
    sheets: [{
      name: "Revenue",
      rows: [
        ["Month", "Revenue", "Growth"],
        ["July", 48200, "+12%"],
        ["August", 61900, "+28%"],
      ],
    }],
  }),
});

const { url } = await res.json();
console.log(url); // https://openofficeai.com/s/...

How to create a spreadsheet with Node.js

  1. 1Grab your API key from the dashboard.
  2. 2Call fetch() against /api/v1/sheets with your Bearer token and a JSON body of title + sheets[].rows.
  3. 3Use the url from the response — it is live and editable immediately.
  4. 4For documents, POST to /api/v1/docs with a content array of headings and paragraphs instead.

Why use OpenOfficeAI with Node.js

Frequently asked questions

Does this work in serverless and edge functions?

Yes. It is a single fetch call with no native dependencies, so it runs in Vercel/Netlify functions, AWS Lambda, and Cloudflare Workers. Keep your API key in an environment variable, not in client-side code.

Can I create a Word document instead of a spreadsheet?

Yes. POST to /api/v1/docs with a content array, e.g. [{"type":"heading","level":1,"text":"Report"},{"type":"paragraph","text":"..."}]. You get a shareable doc URL and can download it as DOCX or PDF.

How do I keep my API key secret in the browser?

Never call the API with your key from client-side JavaScript. Proxy the request through your own backend route (Next.js Route Handler, Express endpoint) that reads the key from an environment variable.

Start creating documents with Node.js

Free tier includes 500 API calls per month — no card required.

Related integrations