@arcjet/transport
v1.4.0
Published
Transport mechanisms for the Arcjet protocol
Readme
@arcjet/transport
Transport mechanisms for the Arcjet protocol.
What is this?
This package provides a way to talk to our protocol.
When should I use this?
This is an internal Arcjet package not designed for public use. See our Get started guide for how to use Arcjet in your application.
Install
This package is ESM only. Install with npm in Node.js:
npm install @arcjet/transportUse
import { createTransport } from "@arcjet/transport";
const transport = createTransport("https://decide.arcjet.com");
// This can now be passed to `createClient` from `@arcjet/protocol`.API
This package exports the identifier
createTransport.
There is no default export.
This package exports no TypeScript types.
createTransport(baseUrl)
Creates a transport that talks over HTTP/2 using
@connectrpc/connect-node. This is a thin wrapper around
createConnectTransport.
Alternative entry points exist for Bun, Edge Light, and workerd that use
@connectrpc/connect-web instead.
Parameters
baseUrl(string, example:https://example.com/my-api) — the base URL for all HTTP requests
Returns
A Connect transport that you can pass to createClient from
@arcjet/protocol.
