diff --git a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/data-vault/stores/[storeId]/page-client.tsx b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/data-vault/stores/[storeId]/page-client.tsx index 00f88aabb..f1161103a 100644 --- a/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/data-vault/stores/[storeId]/page-client.tsx +++ b/apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/data-vault/stores/[storeId]/page-client.tsx @@ -137,7 +137,7 @@ export default function PageClient({ storeId }: PageClientProps) { const serverExample = deindent` // In your .env file or environment variables: - // STACK_DATA_VAULT_SECRET=insert-a-randomly-generated-secret-here + // HEXCLAVE_DATA_VAULT_SECRET=insert-a-randomly-generated-secret-here const store = await hexclaveServerApp.getDataVaultStore(${JSON.stringify(storeId)}); @@ -146,12 +146,12 @@ export default function PageClient({ storeId }: PageClientProps) { // Get a value for a specific key const value = await store.getValue(key, { - secret: process.env.STACK_DATA_VAULT_SECRET, + secret: process.env.HEXCLAVE_DATA_VAULT_SECRET, }); // Set a value for a specific key await store.setValue(key, "my-value", { - secret: process.env.STACK_DATA_VAULT_SECRET, + secret: process.env.HEXCLAVE_DATA_VAULT_SECRET, }); `; diff --git a/docs-mintlify/guides/apps/authentication/user-onboarding.mdx b/docs-mintlify/guides/apps/authentication/user-onboarding.mdx index 312f50d58..9ecb88f84 100644 --- a/docs-mintlify/guides/apps/authentication/user-onboarding.mdx +++ b/docs-mintlify/guides/apps/authentication/user-onboarding.mdx @@ -74,7 +74,7 @@ Next, we can create a hook/function to check if the user has completed onboardin ```jsx - import { hexclaveServerApp } from '@/stack/server'; + import { hexclaveServerApp } from '@/hexclave/server'; import { redirect } from 'next/navigation'; export async function ensureOnboarded() { @@ -108,7 +108,7 @@ You can then use these functions wherever onboarding is required: ```jsx import { ensureOnboarding } from '@/app/onboarding-functions'; - import { hexclaveServerApp } from '@/stack/server'; + import { hexclaveServerApp } from '@/hexclave/server'; export default async function HomePage() { await ensureOnboarding(); diff --git a/docs-mintlify/guides/apps/launch-checklist/overview.mdx b/docs-mintlify/guides/apps/launch-checklist/overview.mdx index c7e19033c..1724c5fc1 100644 --- a/docs-mintlify/guides/apps/launch-checklist/overview.mdx +++ b/docs-mintlify/guides/apps/launch-checklist/overview.mdx @@ -14,7 +14,7 @@ Follow these steps when you're ready to push your application to production: - Navigate to the `Domain & Handlers` tab in the Hexclave dashboard. If you haven't configured your handler, you can leave it as the default. (Learn more about handlers [here](/sdk/objects/stack-app)). + Navigate to the `Domain & Handlers` tab in the Hexclave dashboard. If you haven't configured your handler, you can leave it as the default. (Learn more about handlers [here](/sdk/objects/hexclave-app)). For enhanced security, disable the `Allow all localhost callbacks for development` option. diff --git a/docs-mintlify/guides/apps/payments/checkout.mdx b/docs-mintlify/guides/apps/payments/checkout.mdx index cd3b74c8e..60c21b886 100644 --- a/docs-mintlify/guides/apps/payments/checkout.mdx +++ b/docs-mintlify/guides/apps/payments/checkout.mdx @@ -32,7 +32,7 @@ The `createCheckoutUrl` method is available on both user and team objects. ```typescript title="app/purchase/page.tsx" - import { hexclaveServerApp } from "@/stack/server"; + import { hexclaveServerApp } from "@/hexclave/server"; export default async function PurchasePage() { const user = await hexclaveServerApp.getUser({ or: 'redirect' }); diff --git a/docs-mintlify/guides/apps/payments/granting-products.mdx b/docs-mintlify/guides/apps/payments/granting-products.mdx index 1a267b165..76596106d 100644 --- a/docs-mintlify/guides/apps/payments/granting-products.mdx +++ b/docs-mintlify/guides/apps/payments/granting-products.mdx @@ -8,6 +8,8 @@ Sometimes you need to give a customer a product without charging them - free tri ## Granting a configured product ```typescript +import { hexclaveServerApp } from "@/hexclave/server"; + // Grant a pre-configured product to a user await hexclaveServerApp.grantProduct({ userId: "user-id", @@ -34,6 +36,8 @@ If you already have a reference to a **server** user or team object (for example You can also grant products with an **inline definition** - no pre-configured product needed. This is useful for one-off grants like bonus credits: ```typescript +import { hexclaveServerApp } from "@/hexclave/server"; + await hexclaveServerApp.grantProduct({ userId: "user-id", product: { diff --git a/docs-mintlify/guides/apps/payments/items-and-entitlements.mdx b/docs-mintlify/guides/apps/payments/items-and-entitlements.mdx index 204d83f12..d5e9533ab 100644 --- a/docs-mintlify/guides/apps/payments/items-and-entitlements.mdx +++ b/docs-mintlify/guides/apps/payments/items-and-entitlements.mdx @@ -50,7 +50,7 @@ export default function CreditsWidget() { When your app needs to consume credits (e.g. when a user sends an AI request), use `tryDecreaseQuantity` on the server. It's a single transactional operation - it returns `false` and does nothing if the balance would go negative, so concurrent requests can't overspend. ```typescript title="lib/credits.ts" -import { hexclaveServerApp } from "@/stack/server"; +import { hexclaveServerApp } from "@/hexclave/server"; export async function consumeCredits(userId: string, amount: number) { const user = await hexclaveServerApp.getUser(userId); diff --git a/docs-mintlify/guides/apps/payments/subscriptions.mdx b/docs-mintlify/guides/apps/payments/subscriptions.mdx index acbe57a3c..bcefd4fbc 100644 --- a/docs-mintlify/guides/apps/payments/subscriptions.mdx +++ b/docs-mintlify/guides/apps/payments/subscriptions.mdx @@ -57,6 +57,8 @@ export default function UpgradeButton() { ```typescript + import { hexclaveServerApp } from "@/hexclave/server"; + // Cancel for the current user await hexclaveServerApp.cancelSubscription({ productId: "prod_pro" }); diff --git a/docs-mintlify/guides/other/tutorials/build-a-team-based-app.mdx b/docs-mintlify/guides/other/tutorials/build-a-team-based-app.mdx index db57f452c..9cb21e21d 100644 --- a/docs-mintlify/guides/other/tutorials/build-a-team-based-app.mdx +++ b/docs-mintlify/guides/other/tutorials/build-a-team-based-app.mdx @@ -17,7 +17,7 @@ If you have not installed Stack yet (handler routes, `HexclaveProvider`, environ ## Prerequisites -- Hexclave installed as in [Build a SaaS with Hexclave](/guides/other/tutorials/build-a-saas-with-hexclave) (Next.js App Router examples below assume `hexclaveServerApp` in `stack/server.ts` and `@hexclave/next` in the app). +- Hexclave installed as in [Build a SaaS with Hexclave](/guides/other/tutorials/build-a-saas-with-hexclave) (Next.js App Router examples below assume `hexclaveServerApp` in `hexclave/server.ts` and `@hexclave/next` in the app). - A project in the [dashboard](https://app.hexclave.com/projects) where you can edit **Teams** and **Team permissions**. @@ -42,7 +42,7 @@ Use the **current user** as the scope: `listTeams` / `useTeams`, and `getTeam` / ```tsx title="app/team/[teamId]/page.tsx" import Link from "next/link"; - import { hexclaveServerApp } from "@/stack/server"; + import { hexclaveServerApp } from "@/hexclave/server"; type PageProps = { params: { teamId: string } }; @@ -101,7 +101,7 @@ If your framework types route `params` as a `Promise` (newer Next.js), `await` t ```tsx title="app/team/page.tsx" import Link from "next/link"; - import { hexclaveServerApp } from "@/stack/server"; + import { hexclaveServerApp } from "@/hexclave/server"; export default async function TeamsIndexPage() { const user = await hexclaveServerApp.getUser({ or: "redirect" }); @@ -179,7 +179,7 @@ export function CreateWorkspaceButton() { For imports, support tools, or other **server** jobs, `hexclaveServerApp.createTeam` creates a team at project scope (see [Teams](/guides/apps/teams/overview)); wire membership separately if your flow requires it. ```tsx title="scripts/provision-team.example.ts" -import { hexclaveServerApp } from "@/stack/server"; +import { hexclaveServerApp } from "@/hexclave/server"; export async function provisionEmptyTeam(displayName: string) { return await hexclaveServerApp.createTeam({ displayName }); @@ -226,7 +226,7 @@ Replace `export_reports` with a permission you created. ```tsx title="app/team/[teamId]/reports/page.tsx" - import { hexclaveServerApp } from "@/stack/server"; + import { hexclaveServerApp } from "@/hexclave/server"; type PageProps = { params: { teamId: string } }; @@ -289,7 +289,7 @@ For listing effective permissions, use `listPermissions` / `usePermissions` ([RB ```tsx title="app/actions/reports.ts" "use server"; -import { hexclaveServerApp } from "@/stack/server"; +import { hexclaveServerApp } from "@/hexclave/server"; export async function requestReportExportAction(teamId: string) { const user = await hexclaveServerApp.getUser({ or: "throw" }); diff --git a/docs-mintlify/guides/other/tutorials/ship-production-ready-auth.mdx b/docs-mintlify/guides/other/tutorials/ship-production-ready-auth.mdx index 990e40ab9..012e1426e 100644 --- a/docs-mintlify/guides/other/tutorials/ship-production-ready-auth.mdx +++ b/docs-mintlify/guides/other/tutorials/ship-production-ready-auth.mdx @@ -27,7 +27,7 @@ You typically combine **one or more** of: ```tsx title="middleware.ts" import { NextRequest, NextResponse } from "next/server"; - import { hexclaveServerApp } from "@/stack/server"; + import { hexclaveServerApp } from "@/hexclave/server"; export async function middleware(request: NextRequest) { const user = await hexclaveServerApp.getUser(); @@ -48,7 +48,7 @@ You typically combine **one or more** of: ```tsx title="app/app/dashboard/page.tsx" - import { hexclaveServerApp } from "@/stack/server"; + import { hexclaveServerApp } from "@/hexclave/server"; export default async function DashboardPage() { await hexclaveServerApp.getUser({ or: "redirect" }); @@ -76,7 +76,7 @@ You typically combine **one or more** of: - **`{ or: "throw" }`** — use in **server actions**, **route handlers**, and other places where redirecting would be wrong; map errors to `401`/`403` responses yourself. ```tsx title="app/api/me/route.ts" -import { hexclaveServerApp } from "@/stack/server"; +import { hexclaveServerApp } from "@/hexclave/server"; import { NextResponse } from "next/server"; export async function GET() {