{"id":25588588,"url":"https://github.com/picketapi/picket-example-hello-world","last_synced_at":"2026-04-11T05:30:16.729Z","repository":{"id":40588570,"uuid":"473733703","full_name":"picketapi/picket-example-hello-world","owner":"picketapi","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-18T18:15:33.000Z","size":1575,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-08-04T05:11:40.027Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/picketapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-24T18:47:52.000Z","updated_at":"2023-08-04T05:11:40.028Z","dependencies_parsed_at":"2023-01-19T21:46:36.832Z","dependency_job_id":null,"html_url":"https://github.com/picketapi/picket-example-hello-world","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picketapi%2Fpicket-example-hello-world","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picketapi%2Fpicket-example-hello-world/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picketapi%2Fpicket-example-hello-world/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/picketapi%2Fpicket-example-hello-world/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/picketapi","download_url":"https://codeload.github.com/picketapi/picket-example-hello-world/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239985714,"owners_count":19729512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-21T08:38:56.686Z","updated_at":"2026-04-11T05:30:16.647Z","avatar_url":"https://github.com/picketapi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Picket Hello World Example\nFor this example we’ll be using [Next.js](https://nextjs.org/). While few of the [Next.js](https://nextjs.org/) features are needed in this example tutorial, it will create a convenient launching off point for you to build on from this base. It also makes deployment easy through [Vercel](https://vercel.com/).\n\n## 1. Create your next.js app.\nIn your terminal `cd` into the directory where you’d like your project folder to reside and enter the following into the terminal:\n`npx create-next-app@latest —typescript`\n\nConfirm your app is running on localhost by running\n `npm run dev`\n\n## 2. Install the Picket React SDK \n\n```shell\nnpm install --save \"@picketapi/picket-react\"\n```\n\n## 3. Setup the Picket Provider \nReplace the contents of `pages/_app.tsx` with the following: \n\n```tsx\nimport \"../styles/globals.css\";\nimport type { AppProps } from \"next/app\";\n\nimport { PicketProvider } from \"@picketapi/picket-react\";\n\nconst apiKey = \"YOUR_PUBLISHABLE_KEY_GOES_HERE\";\n\nfunction MyApp({ Component, pageProps }: AppProps) {\n  return (\n    \u003cPicketProvider apiKey={apiKey}\u003e\n      \u003cComponent {...pageProps} /\u003e\n    \u003c/PicketProvider\u003e\n  );\n}\n\nexport default MyApp;\n```\n\nThe `PicketProvider` makes Picket and the user's authentication state available throughout your app via the `usePicket` hook.\n\n## 4. Add Your API Key\nYou'll need to add your publishable API key to make this functional. Navigate to your [Picket account dashboard](https://picketapi.com/dashboard) and copy your publishable key from a project. Now paste it into the `pages/_app.tsx`\n\n```tsx\n// in pages/_app.tsx\n// Replace with your copied publishable key\nconst apiKey = \"YOUR_PUBLISHABLE_KEY_GOES_HERE\";\n```\n\n## 5. Build your home page\nCopy and paste the contents of [pages/index.tsx](https://github.com/picketapi/picket-example-hello-world/blob/main/pages/index.tsx) into your local `pages/index.tsx`.\n\nThe magic method here to initiate logging in a user is `picket.login()`, which is triggered when a user click the `Sign-In with Your Wallet` button.\n\nNext up, replace the contents of your local `styles/Home.module.css` with the [styles/Home.module.css](https://github.com/picketapi/picket-example-hello-world/blob/main/styles/Home.module.css).\n\nWhen you navigate to http://localhost:3000 in your browser you should see the following:\n\n![image](public/picket-example1-app-running-frontend-only.png)\n\n## 6. Try it out!\nNow, when you run `npm run dev` from the command line and navigate to http://localhost:3000 in your browser you should have a working app. You can tap on the `Sign-In with Your Wallet` button to initiate a signing request and verify your wallet.\n\nAssuming you’re in a browser with Metamask installed, when you click on `Sign-In with Your Wallet` you should now see the following: \n\n![image](public/picket-example1-mm-signing-request.png)\n\nAnd when you click sign, you should see your wallet address you used to sign the request displayed on the page. This access token can now be used for the *lifetime of the access token* to *verify* a user’s wallet without needing to ask the user to sign another request.\n\nThis long lived strong guarantee of the user’s ownership of their wallet opens up a world of opportunities for enabling easy and secure web3 experiences. You can use it as a new one click authentication method, for limiting access to private content to certain wallet addresses, as a way to link wallets to existing user accounts and much more. \n\nWant to move beyond authenticating wallets and interested in how this same `picket.login()` method can be used to token gate services and verify a user has ownership of a given token? Check out the *Token Gating Tutorial*. It’s just one more step!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicketapi%2Fpicket-example-hello-world","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpicketapi%2Fpicket-example-hello-world","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpicketapi%2Fpicket-example-hello-world/lists"}