docs: add package manager switching to index.md
This commit is contained in:
+12
-2
@@ -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 })`.
|
||||
Note that the token will immediately be deleted after this. To prevent this, use `await cap.validateToken("...", { keepToken: true })`.
|
||||
|
||||
Reference in New Issue
Block a user