Build your own credential collection flow with full control over the look, feel, and UX, and Deck stores the credentials securely in the Credential Vault.Documentation Index
Fetch the complete documentation index at: https://docs.deck.co/llms.txt
Use this file to discover all available pages before exploring further.
How it works
Credentials go directly from the user to your server over HTTPS. Your server stores them with Deck. The credential is created immediately withunverified status and becomes verified the first time a task run authenticates successfully.
Credential statuses
When you first store a credential, it starts asunverified. The credential is verified automatically when it is used successfully in a task run. During that task run, the source may require additional input from the user — like an MFA code or a security question — which puts the task run into an interaction_required state. Once any required interactions are resolved and the task run completes successfully, the credential moves to verified. If the source rejects the credentials, the status becomes invalid.
| Status | What to show |
|---|---|
unverified | Credentials stored. Ready to use on task runs. |
verified | Credentials confirmed working. |
invalid | Source rejected the credentials. Prompt the user to update. |
deleted | Credential was permanently removed. |
Step-by-step implementation
Build a credential form
Start with a form that collects the credentials required by the source. Most sources use
username_password.Store the credential server-side
Your server receives the credentials and stores them with Deck. This can be an Express handler, a Next.js API route, or any server-side endpoint.The response comes back with
status: "unverified". The credentials are encrypted and stored in the Credential Vault.Listen for credential events
Deck sends events to your event destination when credential statuses change.Use the The task run resumes where it left off and continues to completion. A task run may require multiple interactions — for example, an MFA code followed by a security question. See the Interactions guide for more detail.
Handling interactions
Some sources require additional input during a task run, like an MFA code or a security question. When this happens, the task run pauses and Deck fires atask_run.interaction_required event. The event includes an interaction object that describes what the source needs:fields array to render a form that collects the required input. Once you have the user’s response, submit it to resume the task run:Handling errors
Build your UI to handle common failure cases gracefully:| Scenario | What happened | Recommended UX |
|---|---|---|
| Invalid credentials | Source rejected the username/password during a task run | Show an error. Let the user update the credential with corrected details. |
| Source unavailable | The target website is down or blocking | Show a temporary error. Suggest trying again later. |
| Credential deleted | Credential was permanently removed | Prompt the user to add new credentials. |
Updating credentials
When a credential becomesinvalid, prompt the user to re-enter their details and update the credential with a PATCH request.
unverified and will be re-verified on the next task run.