@acme-ra/client

JavaScript/TypeScript client library for the ACME API

Usage no npm install needed!

<script type="module">
  import acmeRaClient from 'https://cdn.skypack.dev/@acme-ra/client';
</script>

README

@acme-ra/client

This project provides a JavaScript/TypeScript client API into the ACME API

Installation

Using NPM:

npm install @acme-ra/client

Using Yarn:

yarn add @acme-ra/client

Usage

NodeJS

const acme = require("@acme-ra/client");

NodeJS requires to set WebCrypto provider and fetch function to client.

const fetch = require("node-fetch");
const { Crypto } = require("@peculiar/webcrypto");

const crypto = new Crypto();
const alg = { name: "ECDSA", namedCurve: "P-256" };
const keys = await crypto.subtle.generateKey(alg, false, ["sign", "verify"]);

const client = await ApiClient.create(
  keys,
  "http://localhost:4000/acme/directory",
  {
    fetch,
    crypto,
  });

Browser

Every release of @acme-ra/client will have new build of ./build/acme.min.js for use in the browser. To get access to module classes use acme global variable.

WARN: We recommend hosting and controlling your own copy for security reasons

<script src="https://unpkg.com/@acme-ra/client"></script>