Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .claude/commands/docs-reviewer.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
description: Alchemy Documentation Reviewer
argument-hint: [file1.mdx] [file2.mdx] [...]
argument-hint: [file1.mdx] [file2.mdx] [...] OR [docs/pages/directory/]
---

# Alchemy Smart Wallets Documentation Reviewer

You are an AI assistant that automatically fixes documentation for Alchemy's Smart Wallets product. You systematically apply fixes to MDX files within the `/docs` directory to ensure compliance with contribution guidelines defined in [docs/CONTRIBUTING.md](/docs/CONTRIBUTING.md)
You are an AI assistant that automatically fixes documentation for Alchemy's Smart Wallets product. You systematically apply fixes to MDX files within the `/docs` directory to ensure compliance with contribution guidelines defined in [docs/CONTRIBUTING.md](/docs/CONTRIBUTING.md). Spend as much time as needed to ensure all fixes are applied for every file processed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Richard-Dang Im assuming these changes are intentional but want you to confirm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't recall adding this but I assume someone else did. Should be fine to leave it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think the AI bot itself added these lol? idt the instturction of take as much time as you need is great


**⚠️ CRITICAL**: Do not modify existing code snippets beyond formatting (indentation, language tags). Code changes can break functionality.

Expand Down Expand Up @@ -43,5 +43,6 @@ You are an AI assistant that automatically fixes documentation for Alchemy's Sma
- `/docs-reviewer` - Process all changed MDX files in current branch
- `/docs-reviewer docs/pages/core/quickstart.mdx` - Process single file
- `/docs-reviewer docs/pages/core/quickstart.mdx docs/pages/react/overview.mdx` - Process multiple files
- `/docs-reviewer docs/pages/authentication/` - Process all nested MDX files within the specified directory

**Note**: When processing specific files via arguments, they will be reviewed regardless of git status. When no arguments are provided, only changed files in the current branch are processed.
178 changes: 178 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
---
applyTo: "**/*.mdx"
---

# Alchemy Smart Wallets Documentation Reviewer

You are an AI assistant reviewing documentation changes for Alchemy's Smart Wallets product. Apply systematic validation following the priority order below.

## 🎯 Review Priority Order (CRITICAL)

1. **TERMINOLOGY ENFORCEMENT** (Highest Priority)
2. **VOICE AND TONE COMPLIANCE**
3. **CODE FORMATTING STANDARDS**
4. **CONTENT STRUCTURE VALIDATION**

## 🚫 Terminology Enforcement (PRIORITY 1)

**IMMEDIATE REJECTION** - Flag these prohibited terms and provide exact replacements:

### Critical Replacements:
| ❌ **NEVER USE** | ✅ **REPLACE WITH** | **Template Comment** |
|------------------|---------------------|---------------------|
| `"Account Abstraction"` or `"AA"` | Remove entirely | "Remove Account Abstraction terminology per [style guide](/docs/CONTRIBUTING.md#terminology-standards)" |
| `"user operation"` or `"user ops"` | `"transactions"` | "Use 'transactions' instead of 'user operations' per our terminology standards" |
| `"bundler"` | `"sending transactions"` | "Replace 'bundler' with 'sending transactions' to hide implementation details" |
| `"Account Kit"` | `"Smart Wallets"` | "Use 'Smart Wallets' instead of 'Account Kit' per our branding guidelines" |
| `"gas manager"` | `"sponsor gas"` | "Use 'sponsor gas' instead of 'gas manager' unless referring to Gas Manager API" |
| `"Signer"` | `"authentication"` or `"owner"` | "Replace 'Signer' with 'authentication' or 'owner' for clarity" |

### Brand Reference Violations:
- ❌ `"Alchemy Smart Wallets"` → ✅ `"Smart Wallets"`
- ❌ `"our smart account"` → ✅ `"smart accounts"`
- ❌ `"we recommend"` → ✅ `"recommended approach:"`

## 🗣️ Voice and Tone Validation (PRIORITY 2)

**SYSTEMATIC CHECKS:**

### Second Person Voice (REQUIRED):
```regex
Pattern to flag: \b(we|our|us|I|my|one should)\b
Replacement: "you" or restructure with direct commands
```

**Examples:**
- ❌ `"We recommend installing..."` → ✅ `"Install..."`
- ❌ `"Our SDK provides..."` → ✅ `"The SDK provides..."`
- ❌ `"You should configure..."` → ✅ `"Configure..."`

### Active Voice Detection:
```regex
Pattern to flag: \b(is|are|was|were|been)\s+(created|configured|implemented|used)\b
Fix: Convert to active voice with direct commands
```

### Confidence Level Check:
```regex
Pattern to flag: \b(perhaps|might|maybe|possibly|you may wish|you might want)\b
Fix: Remove qualifiers, use direct statements
```

## 💻 Code Standards Validation (PRIORITY 3)

**AUTOMATED CHECKS:**

### Technical Term Formatting:
- **ALL** function names, variables, and technical terms MUST use backticks
- Code blocks MUST specify language: `ts`, `jsx`, `bash`
- Examples MUST include `twoslash` for TypeScript: ```ts twoslash

### Missing Backticks Detection:
```regex
Common patterns to flag (not exhaustive):
- SDK method names without backticks
- Configuration properties without backticks
- Package names in prose without backticks
```

## 📋 Review Decision Tree

### 1. CRITICAL ISSUES (Request Changes):
- ✅ Any prohibited terminology found
- ✅ First-person voice ("we", "our", "I")
- ✅ Headers containing AA-specific terms
- ✅ Missing backticks on technical terms

### 2. MAJOR ISSUES (Request Changes):
- ✅ Passive voice in instructions
- ✅ Broken or incorrect relative links
- ✅ Code blocks without language specification
- ✅ Examples missing prerequisites

### 3. MINOR ISSUES (Suggest Changes):
- ✅ Inconsistent capitalization
- ✅ Verbose explanations that could be more direct
- ✅ Missing alt text on images

## 🤖 AI-Optimized Feedback Templates

**Copy these exact templates for common issues:**

### Terminology Violation:
```
**TERMINOLOGY ISSUE**: Replace "[PROHIBITED_TERM]" with "[APPROVED_TERM]" per our style guide.

Reference: [Terminology Standards](/docs/CONTRIBUTING.md#terminology-standards)

Specific fix: [EXACT_REPLACEMENT_TEXT]
```

### Voice Issue:
```
**VOICE ISSUE**: Convert to second person active voice.

Current: "[CURRENT_TEXT]"
Suggested: "[IMPROVED_TEXT]"

Reference: [Voice Standards](/docs/CONTRIBUTING.md#voice-and-tone-standards)
```

### Code Formatting:
```
**FORMATTING ISSUE**: Technical terms need backticks.

Fix: Wrap `[TERM]` in backticks for proper formatting.

Reference: [Code Standards](/docs/CONTRIBUTING.md#code-and-technical-standards)
```

### Missing Language Specification:
```
**CODE BLOCK ISSUE**: Add language specification to code blocks.

Change:
\`\`\`
[code]
\`\`\`

To:
\`\`\`ts twoslash
[code]
\`\`\`
```

## ✅ Pre-Approval Checklist

**Before approving ANY documentation, verify:**

- [ ] **NO prohibited terms** anywhere in the document
- [ ] **Second person voice** used throughout ("you" not "we/I")
- [ ] **Active voice** for all instructions
- [ ] **Direct commands** without qualifiers
- [ ] **Backticks** around all technical terms
- [ ] **Language specified** in all code blocks
- [ ] **Working examples** with prerequisites
- [ ] **Relative links** (not full URLs)
- [ ] **No broken links** or circular references

## 🎯 Success Criteria

**APPROVE when:**
- Zero terminology violations detected
- Consistent second-person active voice throughout
- All technical terms properly formatted
- Examples are standalone and functional
- Headers focus on developer outcomes, not implementation

**REQUEST CHANGES when:**
- Any prohibited terminology found
- Voice violations present
- Missing technical formatting
- Broken or non-functional examples

---

**Reference**: All standards defined in [docs/CONTRIBUTING.md](/docs/CONTRIBUTING.md)

**AI Assistant Note**: This document is structured for systematic validation. Process each section in priority order for consistent, thorough reviews.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Integrate your existing authentication system with Alchemy Smart Wa
slug: wallets/authentication/login-methods/bring-your-own-auth
---

Integrate your existing authentication provider and add smart wallet functionality to your app without changing your users' login experience. We support JWT-based and OIDC-compliant authentication providers.
Integrate your existing authentication provider and add smart wallet functionality to your app without changing your users' login experience. Smart Wallets supports JWT-based and OIDC-compliant authentication providers.

## Prerequisites

Expand Down Expand Up @@ -67,12 +67,12 @@ Your JWTs must contain these claims:
**Important**: The `nonce` claim must be `toHex(sha256(targetPublicKey))` **without** the leading `0x`.

<Note>
You can generate the `targetPublicKey` from the [Alchemy Signer
Generate the `targetPublicKey` from the [Alchemy Signer
SDK](/wallets/reference/account-kit/signer/classes/AlchemySignerWebClient/targetPublicKey)
</Note>

<Tip>
If your OAuth provider reserves the `nonce` claim, you can use `tknonce` as an
If your OAuth provider reserves the `nonce` claim, use `tknonce` as an
alternative. Only one of `nonce` or `tknonce` needs to be set.
</Tip>

Expand All @@ -83,7 +83,7 @@ Your JWTs must contain these claims:

### 4. Audience Claim

The `aud` claim must be set to your Alchemy-provided audience ID. You can obtain the audience claim from your Smart Wallet configuration in the [Alchemy Dashboard](https://dashboard.alchemy.com/accounts/config/create).
Set the `aud` claim to your Alchemy-provided audience ID. Obtain the audience claim from your Smart Wallet configuration in the [Alchemy Dashboard](https://dashboard.alchemy.com/accounts/config/create).

<img src="/images/wallets/bring-your-own-auth.png" alt="Audience Claim" />

Expand Down Expand Up @@ -271,10 +271,10 @@ Use [jwt.io](https://jwt.io/) to decode and validate your JWT structure before i

## Next Steps

### Sending a User Operation
### Sending Transactions

Once your users have been authenticated, you can start [sending user operations](/wallets/transactions/send/send-user-operations).
Once your users authenticate, start [sending transactions](/wallets/transactions/send/send-user-operations).

### Sponsor Gas for a User Operation
### Sponsor Gas for Transactions

Start [sponsoring gas fees](/wallets/transactions/sponsor-gas/sponsor-gas) for transactions via the Gas Manager.
[Sponsor gas fees](/wallets/transactions/sponsor-gas/sponsor-gas) for transactions via the Gas Manager.
20 changes: 10 additions & 10 deletions docs/pages/authentication/login-methods/email-magic-link.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Email magic link authentication is a two-step process:
2. The user clicks the link in their email, which redirects them back to your application to complete authentication

<Tip>
Email OTP has been shown to have up to a 3x higher conversion rate and a
10-second faster flow compared to magic links. Consider using [Email
Email OTP has up to a 3x higher conversion rate and a 10-second faster flow
compared to magic links. Use [Email
OTP](/wallets/authentication/login-methods/email-otp) for better user
experience.
</Tip>
Expand All @@ -20,7 +20,7 @@ Email magic link authentication is a two-step process:
<Tab title="React">
## Implementation Options

You can implement Email Magic Link authentication in two ways:
Implement Email Magic Link authentication in two ways:

- [Pre-built UI Components](#pre-built-ui-components) - Quick implementation with minimal code
- [Custom UI](#custom-ui) - Complete control over the user experience
Expand All @@ -41,7 +41,7 @@ Email magic link authentication is a two-step process:

### Step 2: Configure Email Magic Link in UI Components

After adding the components, configure the Email Magic Link authentication in your application config:
After adding the components, configure Email Magic Link authentication in your application config:

```tsx twoslash
import { AlchemyAccountsUIConfig, createConfig } from "@account-kit/react";
Expand Down Expand Up @@ -75,7 +75,7 @@ Email magic link authentication is a two-step process:

## Custom UI

If you need complete control over the user experience, you can implement your own custom UI for Email Magic Link authentication using Smart Wallets hooks.
If you need complete control over the user experience, implement your own custom UI for Email Magic Link authentication using Smart Wallets hooks.

### Step 1: Send the Magic Link

Expand Down Expand Up @@ -110,7 +110,7 @@ Email magic link authentication is a two-step process:

### Step 2: Handle the Redirect

When the user clicks the magic link in their email, they'll be redirected back to your application. You need to extract the authentication bundle from the URL and complete the authentication:
When the user clicks the magic link in their email, they're redirected back to your application. Extract the authentication bundle from the URL and complete the authentication:

```tsx twoslash
import { useEffect } from "react";
Expand Down Expand Up @@ -195,7 +195,7 @@ Email magic link authentication is a two-step process:

### Send an Email Magic Link to a User

To send an email magic link to a user, you can use the `authenticate()` function from the `useAuthenticate()` hook with the `type` set to `email` and the `emailMode` set to `magicLink`.
To send an email magic link to a user, use the `authenticate()` function from the `useAuthenticate()` hook with the `type` set to `email` and the `emailMode` set to `magicLink`.

```tsx twoslash sign-in-with-magic-link.tsx
import { useAuthenticate } from "@account-kit/react-native";
Expand Down Expand Up @@ -256,7 +256,7 @@ Email magic link authentication is a two-step process:

### Authenticate User via Deep Link

When a user clicks on the magic link in their email, it should deep link to your app if this has been setup correctly.
When a user clicks the magic link in their email, it deep links to your app if configured correctly.

A `bundle` parameter present in the deep link url will be used to authenticate the user and save the user's session.

Expand Down Expand Up @@ -315,7 +315,7 @@ Email magic link authentication is a two-step process:
Email magic link authentication allows you to log in and sign up users using an email address. Your users will receive a link in their inbox which will redirect them to your site (configured in the dashboard) to complete login.

<Tip>
We recommend using the OTP email flow instead, as it is more reliable across different browser environments. OTP flows have also been shown to have up to a 3x higher conversion rate and a 10-second faster flow compared to magic link.
Use the OTP email flow instead, as it's more reliable across different browser environments. OTP flows have up to a 3x higher conversion rate and a 10-second faster flow compared to magic links.

For setting up the OTP flow, see [Email OTP Authentication](/wallets/authentication/login-methods/email-otp).
</Tip>
Expand Down Expand Up @@ -381,4 +381,4 @@ Email magic link authentication is a two-step process:

### Add Authenticator App (TOTP) Verification (Optional)

Consider enabling [Multi-Factor Authentication](/wallets/react/mfa/setup-mfa) to require users to enter a 6-digit TOTP code from their authenticator app after clicking the magic link. This extra layer of security protects user accounts if their email is compromised.
Enable [Multi-Factor Authentication](/wallets/react/mfa/setup-mfa) to require users to enter a 6-digit TOTP code from their authenticator app after clicking the magic link. This extra layer of security protects user accounts if their email is compromised.
12 changes: 6 additions & 6 deletions docs/pages/authentication/login-methods/email-otp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Email OTP (One-Time Password) authentication is a two-step process:
<Tab title="React">
## Overview

You can implement Email OTP authentication in two ways:
Implement Email OTP authentication in two ways:

- [Pre-built UI Components](#pre-built-ui-components) - Quick implementation with minimal code
- [Custom UI](#custom-ui) - Complete control over the user experience
Expand All @@ -34,7 +34,7 @@ Email OTP (One-Time Password) authentication is a two-step process:

### Step 2: Configure Email OTP in UI Components

After adding the components, configure the Email OTP authentication in your application config:
After adding the components, configure Email OTP authentication in your application config:

```tsx twoslash
import { AlchemyAccountsUIConfig, createConfig } from "@account-kit/react";
Expand Down Expand Up @@ -68,7 +68,7 @@ Email OTP (One-Time Password) authentication is a two-step process:

## Custom UI

If you need complete control over the user experience, you can implement your own custom UI for Email OTP authentication using Smart Wallets hooks.
If you need complete control over the user experience, implement your own custom UI for Email OTP authentication using Smart Wallets hooks.

### Step 1: Send the OTP

Expand Down Expand Up @@ -125,7 +125,7 @@ Email OTP (One-Time Password) authentication is a two-step process:

### Step 3: Verify the OTP

Once the user receives the code, they'll enter it in your application:
Once the user receives the code, they enter it in your application:

```tsx twoslash
import { useAuthenticate } from "@account-kit/react";
Expand Down Expand Up @@ -189,7 +189,7 @@ Email OTP (One-Time Password) authentication is a two-step process:

<Tip>
This is the default mode for email authentication. Only follow these steps if
you had previously set the email mode to `Magic Link`.
you previously set the email mode to Magic Link.
</Tip>

In your Alchemy Accounts Dashboard:
Expand Down Expand Up @@ -549,4 +549,4 @@ Email OTP (One-Time Password) authentication is a two-step process:

### Add Authenticator App (TOTP) Verification (Optional)

If you'd like to add a **second security step** to Email OTP, you can enable [Multi-Factor Authentication](/wallets/react/mfa/setup-mfa). This prompts users for a **6-digit TOTP code** from their authenticator app (e.g. Google Authenticator, Authy) after they verify their email.
Add a **second security step** to Email OTP by enabling [Multi-Factor Authentication](/wallets/react/mfa/setup-mfa). This prompts users for a **6-digit TOTP code** from their authenticator app (e.g. Google Authenticator, Authy) after they verify their email.
Loading
Loading