The best way to control Claude Code, Codex and more from any computer or phone
| 1 | # @alchemy.run/acme |
| 2 | |
| 3 | ACME certificates for [Alchemy](https://alchemy.run). Issue and renew TLS certificates from Let's Encrypt, ZeroSSL, Google Trust Services, or any ACME CA, independently of where you host, at deploy time or from inside an application. |
| 4 | |
| 5 | ```sh |
| 6 | npm install alchemy @alchemy.run/acme @alchemy.run/cloudflare effect |
| 7 | ``` |
| 8 | |
| 9 | An account and a certificate validated through a Cloudflare DNS zone: |
| 10 | |
| 11 | ```typescript |
| 12 | // alchemy.run.ts |
| 13 | import * as Alchemy from "alchemy"; |
| 14 | import * as ACME from "@alchemy.run/acme"; |
| 15 | import * as Cloudflare from "@alchemy.run/cloudflare"; |
| 16 | import * as Config from "effect/Config"; |
| 17 | import * as Effect from "effect/Effect"; |
| 18 | import * as Layer from "effect/Layer"; |
| 19 | |
| 20 | export default Alchemy.Stack( |
| 21 | "Certificates", |
| 22 | { |
| 23 | providers: Layer.mergeAll(ACME.providers(), Cloudflare.providers()), |
| 24 | state: Alchemy.localState(), |
| 25 | }, |
| 26 | Effect.gen(function* () { |
| 27 | const account = yield* ACME.Account("Issuer", { |
| 28 | ca: ACME.LetsEncryptStaging, |
| 29 | contact: ["mailto:ops@example.com"], |
| 30 | termsOfServiceAgreed: true, |
| 31 | }); |
| 32 | |
| 33 | const certificate = yield* ACME.Certificate("Site", { |
| 34 | account, |
| 35 | identifiers: ["example.com"], |
| 36 | solver: Cloudflare.ACME.ZoneSolver({ |
| 37 | zoneId: Config.String("CLOUDFLARE_ZONE_ID"), |
| 38 | }), |
| 39 | }); |
| 40 | |
| 41 | return { serial: certificate.serial, expires: certificate.notAfter }; |
| 42 | }), |
| 43 | ); |
| 44 | ``` |
| 45 | |
| 46 | Each deploy checks the certificate and renews it once it enters its renewal window. There is no background timer, so redeploy on a schedule. |
| 47 | |
| 48 | ## Learn more |
| 49 | |
| 50 | - [ACME on alchemy.run](https://alchemy.run/acme) |
| 51 | - [Getting started](https://alchemy.run/acme/getting-started) |
| 52 | - [Certificate authorities](https://alchemy.run/acme/certificate-authorities) |
| 53 | - [Renewal](https://alchemy.run/acme/renewal) |