From e9f1ea46404a85b20e96097dc51916baf84b31f0 Mon Sep 17 00:00:00 2001 From: Tiago <70700766+tiagorangel1@users.noreply.github.com> Date: Mon, 14 Apr 2025 12:59:05 +0100 Subject: [PATCH] docs: add package manager switching to index.md --- docs/guide/index.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/guide/index.md b/docs/guide/index.md index 646afe7..0294bd9 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -51,12 +51,22 @@ Alternatively, you can use `onsolve=""` directly within the widget or wrap the w Cap is fully self-hosted, so you'll need to start a server with the Cap API running at the same URL as specified in the `data-cap-api-endpoint` attribute. This is easy since we've already pre-made a library to help you generate and validate challenges for you. -Start by installing it using npm or bun: +Start by installing it: +::: code-group + +```bash [bun] +bun add @cap.js/server ``` + +```bash [npm] npm i @cap.js/server ``` +```bash [pnpm] +pnpm i @cap.js/server +``` + > [!NOTE] > It is recommended to use at least Node.js 14 or Bun 1.0.0. You might experience multiple issues on older versions of these runtimes. @@ -190,4 +200,4 @@ Once the token is generated and captured, you can use it later to validate the u await cap.validateToken("..."); // returns { success: Boolean } ``` -Note that the token will immediately be deleted after this. To prevent this, use `await cap.validateToken("...", { keepToken: true })`. \ No newline at end of file +Note that the token will immediately be deleted after this. To prevent this, use `await cap.validateToken("...", { keepToken: true })`.