{"id":100835,"plugin_id":"plugin_asdk_app_6ae65c2bac0881918812c63246c7e6c9","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-11-17T06:14:34.678Z","digest":"dafa123cc1be0998441702e193957164c9d2d85a548497403ae2cdaf2c7f7a77","against":null,"payload":{"description":"Add Proofable access control to a host app. Define a Gate Policy in code, drop in the gate widget, wire the server check, and test the flow. Use when a developer wants to gate content or add proof-based checks.","included_files":[{"relative_path":"references/quickstart.md","size_in_bytes":3442}],"name":"proofable-integrate","skill_md_contents":"---\r\nname: proofable-integrate\r\ndescription: Add Proofable access control to a host app. Define a Gate Policy in code, drop in the gate widget, wire the server check, and test the flow. Use when a developer wants to gate content or add proof-based checks.\r\nlicense: Apache-2.0\r\ncompatibility: Requires @proofable/sdk (npm).\r\nmetadata:\r\n  author: Proofable\r\n  version: \"0.1.8\"\r\n  homepage: https://docs.proofable.me/use-cases/gate-access\r\n---\r\n\r\n# Integrate Proofable\r\n\r\nAdd proof-based access control. Define the policy in app code; a published `gateId` is optional.\r\n\r\n## Ask once\r\n\r\nBefore writing code, ask the developer:\r\n\r\n1. **What framework?** (Next.js, Vite/React, Express, other)\r\n2. **What must already be proven?** Start with a verifier id such as `proof-of-human`. A dashboard listing is not required.\r\n\r\nDo not ask about Proofable architecture, proof schemas, wallet setup, or credential choices.\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install @proofable/sdk\r\n```\r\n\r\nReact apps also need `react` and `react-dom` (peer dependencies).\r\n\r\n## Define the policy\r\n\r\n```js\r\nimport { defineGate } from '@proofable/sdk';\r\n\r\nconst gate = defineGate([{ verifierId: 'proof-of-human' }]);\r\n```\r\n\r\n## Browser: gate the content\r\n\r\n### React (Next.js, Vite, CRA)\r\n\r\n```jsx\r\nimport { VerifyGate, ProofBadge } from '@proofable/sdk/widgets';\r\n\r\nfunction ProtectedPage({ gate }) {\r\n  return (\r\n    <VerifyGate gate={gate} onVerified={grantAccess}>\r\n      <ProtectedContent />\r\n    </VerifyGate>\r\n  );\r\n}\r\n```\r\n\r\n`VerifyGate` checks for an existing proof, opens hosted sign-in on proofable.me when a new one is needed, then renders the children.\r\n\r\nOptional: show proof status anywhere with `<ProofBadge qHash={proof.qHash} />`.\r\n\r\n### Non-React (redirect flow)\r\n\r\n```js\r\nimport { getHostedCheckoutUrl } from '@proofable/sdk';\r\n\r\nwindow.location.assign(\r\n  getHostedCheckoutUrl({\r\n    verifiers: ['proof-of-human'],\r\n    returnUrl: 'https://app.example.com/auth/callback',\r\n  }),\r\n);\r\n```\r\n\r\nRead the proof ID (`qHash`) from the callback URL query string, then store it.\r\n\r\n## Server: confirm access\r\n\r\nBefore granting access, confirm the subject still satisfies the policy.\r\n\r\n```js\r\nimport { ProofableClient } from '@proofable/sdk';\r\n\r\nconst client = new ProofableClient();\r\nconst result = await client.gateCheck({\r\n  gate,\r\n  subject: { accountId: user.accountAddress },\r\n});\r\n\r\nif (!result.satisfied) {\r\n  // send the user back to VerifyGate or Proofable sign-in\r\n}\r\n```\r\n\r\nFor server-only apps or CI, use a server key: `new ProofableClient({ apiKey: 'npk_...' })`. Create keys at proofable.me → profile → Account → Access keys. Never paste keys into chat or committed files.\r\n\r\n## Test\r\n\r\n1. Run the app and navigate to the gated page.\r\n2. Confirm `VerifyGate` opens the Proofable sign-in flow.\r\n3. Complete sign-in (wallet, passkey, or OAuth all work).\r\n4. Confirm the gated content renders.\r\n5. Call `gateCheck` from the server. Confirm `satisfied` is `true`.\r\n\r\n## Copy rules\r\n\r\nUser-visible strings in the app should use plain language:\r\n\r\n- \"gate\" or \"access\", not \"verifier\" or \"trust check\"\r\n- \"proof\", not \"qHash\" or \"portable proof\" in UI text\r\n- \"Sign in\" or \"Connect\", not \"mount\" or \"authenticate\"\r\n- \"Your account\", not \"wallet\" or \"DID\" unless the user specifically chose a wallet flow\r\n\r\nFramework wiring, `VerifyGate` props, and client methods: [references/quickstart.md](references/quickstart.md)\r\n\r\n## When to stop\r\n\r\nThe integration is complete when:\r\n\r\n1. `VerifyGate` renders on the gated page.\r\n2. A visitor can sign in and see protected content.\r\n3. The server `gateCheck` call returns `satisfied: true` for a verified visitor.\r\n4. No Proofable jargon appears in user-visible strings.\r\n\r\nDo not add extra Proofable concepts, tools, or surfaces unless the developer asks.\r\n\r\nDocs: [Getting started](https://docs.proofable.me), [Gate access](https://docs.proofable.me/use-cases/gate-access)\r\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}