{"id":26483868,"url":"https://github.com/verida/app-connect-example","last_synced_at":"2025-09-17T11:06:18.762Z","repository":{"id":272234158,"uuid":"915846614","full_name":"verida/app-connect-example","owner":"verida","description":"Example on how to connect an application to a user's Verida APIs","archived":false,"fork":false,"pushed_at":"2025-01-13T05:02:58.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-13T06:18:46.996Z","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/verida.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-13T00:12:43.000Z","updated_at":"2025-01-13T05:03:01.000Z","dependencies_parsed_at":"2025-01-13T06:28:53.395Z","dependency_job_id":null,"html_url":"https://github.com/verida/app-connect-example","commit_stats":null,"previous_names":["verida/app-connect-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verida%2Fapp-connect-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verida%2Fapp-connect-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verida%2Fapp-connect-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verida%2Fapp-connect-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/verida","download_url":"https://codeload.github.com/verida/app-connect-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244554068,"owners_count":20471173,"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-03-20T04:58:28.752Z","updated_at":"2025-09-17T11:06:13.715Z","avatar_url":"https://github.com/verida.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# App Connect Example\n\nThis project is an example showing how your application can connect a user to their Verida Vault and grant your application access to user data and other AI related APIs.\n\n## Getting Started\n\nInstall dependencies and start server:\n\n```sh\nyarn\nyarn start\n```\n\nOnce the server is started, it should open `http://localhost:8080/` in your web browser.\n\nYou can then select the scopes you wish to access and click the `Connect Verida` button to be redirected to grant consent to your local application. Once you consent, an auth token is returned to your application and an example API request is made.\n\n## Connection flow\n\nThe connection flow is as follows:\n\n1. Generate an authentication request URL that includes the requested `scopes` and `redirectUrl` (your application page that handles a successful authentication request)\n2. Redirect the user to the authentication request URL\n3. If the user grants access, they are returned to your application with `auth_roken` in the query parameters\n4. Save the `auth_token` in the local browser or your own database against the user account\n5. Make API requests to the Verida API's setting the `Authorization` header to `Bearer ${authToken}`\n\n## Code examples\n\nSee the [buildConnectUrl()](https://github.com/verida/app-connect-example/blob/main/src/main.ts#L21) for an example of building a connect URL that has an array of requested `scopes` and a `redirectUrl` that returns to your application once the auth token is generated.\n\nSee [main.ts](https://github.com/verida/app-connect-example/blob/main/src/main.ts#L120) for an example of making an API request with the returned API key:\n\n```ts\n$.get({\n    url: `${API_ENDPOINT}/search/universal?keywords=meeting+agenda`,\n    headers: {\n        Authorization: `Bearer ${authToken}`,\n        \"Content-Type\": \"application/json\"\n    },\n    success: (response) =\u003e {\n        console.log(response)\n        // ...\n    }\n})\n```\n\nIt's possible to obtain a list of scopes from the `/auth/scopes` endpoint:\n\n```ts\n$.get({\n    url: `${API_ENDPOINT}/auth/scopes`,\n    success: (response) =\u003e {\n        console.log(response)\n        // ...\n    }\n})\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverida%2Fapp-connect-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fverida%2Fapp-connect-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverida%2Fapp-connect-example/lists"}