Skip to content

Crowdin API

import { createCrowdinClient } from "@crowdin/serverless-apps-sdk/api";
const client = createCrowdinClient();
const strings = await client.sourceStringsApi.listProjectStrings(projectId);

createCrowdinClient() returns a @crowdin/crowdin-api-client instance whose requests are executed by the Crowdin host under the current user’s session - no tokens ever reach the app. See the Crowdin REST API reference for the available endpoints.

Access is limited to the scopes declared in the manifest. An empty scopes array means no API access.

Raw request bodies work like with any other transport, so the Storage API accepts files directly:

const file = new Blob([docxBytes]);
const storage = await client.uploadStorageApi.addStorage("guide.docx", file);
await client.sourceFilesApi.createFile(projectId, {
name: "guide.docx",
storageId: storage.data.id,
});

addStorage accepts a Blob/File, an ArrayBuffer, a typed array, or a string. FormData is the one body type that is not supported - no Crowdin API v2 endpoint requires multipart; pass the raw file instead.

Endpoints that respond with a stream (such as AI chat completions with stream: true) resolve once the stream completes, with the full response as a string. This matches how the client behaves with its native transports - the HttpClient contract has no channel for incremental delivery, so there is no progressive streaming with tokens arriving one by one.

  • GraphQL is not available - the host bridge proxies the REST API (/api/v2) only.
  • FormData bodies are rejected; pass raw files instead.
  • Response headers are not exposed - the client resolves with the parsed body only, like its native transports.
  • Errors surface as the client’s own CrowdinError/CrowdinValidationError, same as with a token.