@interfere/javascript provides a typed client for the Interfere API. Use it for release workflows and other API calls. For capturing errors and sessions inside an app, use the Next.js, Vite, NestJS, or Node.js SDK.
Install
Authenticate
For build operations, use a surface secret key withrelease:write:
publicKeyHeader:
apiKeyHeader: { apiKey: "..." } sends a secret key through x-api-key instead of bearer authentication. Choose a credential accepted by the operation. Keep secret keys out of browser bundles.
Register releases and upload source maps
The Next.js and Vite plugins handle this workflow during builds. For a custom build pipeline, call the release methods in order:- Call
client.releases.createRelease()with the build ID, source commit, and deployment destination. Usenullwhen there is no native destination integration. - Call
client.releases.signSourceMapUploads()with the release slug and complete file inventory, including each file’s build-relative path and declared size. - Call
client.releases.uploadSourceMap()for each file. Upload bytes in ordered chunks with the correct offset, at most 512 KiB per request, before the upload session expires. - Call
client.releases.finalizeSourceMaps()with the complete manifest after every chunk is accepted. Keep source maps until finalization succeeds.
INTERFERE_SOURCE_ID to the same commit SHA used during the build.
Timeouts, retries, and errors
SettimeoutInSeconds and maxRetries on the client or an individual request. Pass abortSignal in request options to cancel a request.
By default, eligible requests retry twice for HTTP 408, 429, and 5xx responses and respect Retry-After. Network failures and other HTTP statuses are not retried. Follow each operation’s retry contract for writes; use maxRetries: 0 when you need to inspect the result before retrying.
API failures throw InterfereError with statusCode and body. Handle the error before using the result, and avoid logging credentials or full response bodies from credential-creation operations.