Skip to main content
Home

latest

Formata client-facing SDK, enabling users of Formata to easily call into their APIs.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a year ago (0.3.1)
class EndpointAuth
extends PayloadAuth

Endpoint authorization. Calls a Formata endpoint, applying response fields as headers. When extending this class, implement 'dirty' and 'authWorkflow' methods.

Constructors

new
EndpointAuth(
space: string,
version: string,
api: string,
endpoint: string,
auth?: PayloadAuth,
)

Constructor.

Properties

Auth to use for this workflow (optional).

optional
response: Record<string, unknown>

Response.

Subject to call to.

Timeout for this auth workflow (ms). Default 15 min.

readonly
uid: string

Get a unique ID. Usually included in the workflow message body as an ID for the endpoint creator to use in the stream workflow. Ex. OAuth2 redirect URI back to Formata job stream.

Methods

Execute auth workflow. Only happens when this is dirty.

Authorize a request. Kicks of an auth workflow if needed.

Is this auth dirty? If returns true, will call out to Formata and do the entire auth workflow.

Set response headers.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@formata/client-sdk

Import symbol

import { EndpointAuth } from "@formata/client-sdk";
or

Import directly with a jsr specifier

import { EndpointAuth } from "jsr:@formata/client-sdk";

Add Package

pnpm i jsr:@formata/client-sdk
or (using pnpm 10.8 or older)
pnpm dlx jsr add @formata/client-sdk

Import symbol

import { EndpointAuth } from "@formata/client-sdk";

Add Package

yarn add jsr:@formata/client-sdk
or (using Yarn 4.8 or older)
yarn dlx jsr add @formata/client-sdk

Import symbol

import { EndpointAuth } from "@formata/client-sdk";

Add Package

vlt install jsr:@formata/client-sdk

Import symbol

import { EndpointAuth } from "@formata/client-sdk";

Add Package

npx jsr add @formata/client-sdk

Import symbol

import { EndpointAuth } from "@formata/client-sdk";

Add Package

bunx jsr add @formata/client-sdk

Import symbol

import { EndpointAuth } from "@formata/client-sdk";