JSPM

  • Created
  • Published
  • Downloads 253
  • Score
    100M100P100Q80134F
  • License Apache-2.0

CLI tool for setting up Authrim OIDC Provider on Cloudflare Workers

Package Exports

  • @authrim/setup
  • @authrim/setup/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@authrim/setup) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@authrim/setup

CLI and Web UI for deploying Authrim OIDC Provider to Cloudflare Workers.

npm version License

Quick Start

# Web UI (recommended)
npx @authrim/setup

# CLI mode
npx @authrim/setup --cli

# Manage existing environments only
npx @authrim/setup manage

Requirements

  • Node.js >= 20.0.0
  • Wrangler CLI installed and authenticated
  • Cloudflare Workers Paid plan

Commands

init (default)

npx @authrim/setup [options]

Options:
  --cli              CLI mode instead of Web UI
  --config <path>    Load existing configuration
  --env <name>       Environment name (prod, staging, dev)

manage

Manage existing environments (no source code required):

npx @authrim/setup manage

deploy

npx @authrim/setup deploy [options]

Options:
  -c, --config <path>  Config file path
  -e, --env <env>      Environment name
  --component <name>   Deploy single component
  --dry-run            Preview without deploying
  --skip-secrets       Skip secrets upload
  -y, --yes            Skip confirmation (CI/CD)

delete

npx @authrim/setup delete [options]

Options:
  --env <name>    Environment to delete
  -y, --yes       Skip confirmation (CI/CD)
  --no-workers    Keep Workers
  --no-d1         Keep D1 databases
  --no-kv         Keep KV namespaces

info

npx @authrim/setup info [options]

Options:
  --env <name>    Environment name
  --json          JSON output (for scripting)
  --d1            D1 info only
  --workers       Worker info only

config

npx @authrim/setup config [options]

Options:
  --show       Show configuration
  --validate   Validate configuration
  --json       JSON output

Configuration Files

File Description
authrim-config.json Environment settings
authrim-lock.json Provisioned resource IDs
.keys/{env}/ Cryptographic keys (gitignored)

Components

Component Description
api Core OIDC API (required)
loginUi Login/consent UI
adminUi Admin dashboard
saml SAML 2.0 IdP
async Email, webhooks
vc Verifiable Credentials
bridge Social login (Google, GitHub, etc.)
policy ReBAC Policy Engine

Resource Naming

Type Pattern Example
Workers {env}-ar-{component} prod-ar-auth
D1 {env}-authrim-{type}-db prod-authrim-core-db
KV {env}-{NAME} prod-CLIENTS_CACHE

CI/CD

# Deploy without prompts
npx @authrim/setup deploy --env prod --yes

# Delete environment
npx @authrim/setup delete --env staging --yes

# Get info as JSON
npx @authrim/setup info --env prod --json | jq '.d1[0].databaseSize'

Environment variables:

  • CLOUDFLARE_API_TOKEN - API token
  • CLOUDFLARE_ACCOUNT_ID - Account ID

Troubleshooting

Wrangler not installed

npm install -g wrangler
wrangler login

Lock file not found

npx @authrim/setup init --env prod

Service Bindings error

Deploy missing components first, or disable them in configuration. The ar-router must be deployed last.

License

Apache License 2.0