{"id":28028389,"url":"https://github.com/permitio/permit-stytch","last_synced_at":"2026-02-12T18:02:37.746Z","repository":{"id":271670160,"uuid":"881380091","full_name":"permitio/permit-stytch","owner":"permitio","description":"A set of webhooks to sync users and tenants from Stytch to Permit.io","archived":false,"fork":false,"pushed_at":"2025-01-09T11:09:00.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-23T22:33:17.497Z","etag":null,"topics":["example"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/permitio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2024-10-31T13:11:06.000Z","updated_at":"2025-03-13T16:17:08.000Z","dependencies_parsed_at":"2025-01-10T08:01:34.114Z","dependency_job_id":null,"html_url":"https://github.com/permitio/permit-stytch","commit_stats":null,"previous_names":["permitio/permit-stytch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/permitio/permit-stytch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permitio%2Fpermit-stytch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permitio%2Fpermit-stytch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permitio%2Fpermit-stytch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permitio%2Fpermit-stytch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/permitio","download_url":"https://codeload.github.com/permitio/permit-stytch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/permitio%2Fpermit-stytch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29375614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["example"],"created_at":"2025-05-11T07:13:00.489Z","updated_at":"2026-02-12T18:02:37.730Z","avatar_url":"https://github.com/permitio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Permit \u003c-\u003e Stytch Integrations\nThis repository contains a collection of webhooks to provision users from Stych authentication service to Permit.io for Fine Grained Authorization.\n\nThe webhooks service is Node.js based and is written using the Express.js web framework.\n\n## Usage\nTo properly run the service, follow these steps.\n\n\u003e To support multiple webhooks that provide different secrets, the project utilizes a custom header named `x-stytch-webhook-secret` that contains the environment variable name of the relevant secret. For example, if the header value is `SYNC_USER_SECRET`, the webhook will look for the `SYNC_USER_SECRET` environment variable to validate the webhook.\n\n### Run the Project\n\n1. Configure the relevant webhooks in Stytch to point to your server.\n1. Create a `.env` file, and copy the content from `.env.template` to it\n    ```\n    cp .env.template .env\n    ```\n2. Replace the `PERMIT_API_TOKEN` and `STYTCH_API_TOKEN` with the proper tokens from Permit and Stytch\n3. Add the relevant webhook secrets to the `.env` file using the same names as the custom header values.\n4. Install the dependencies\n    ```\n    npm install\n    ```\n5. Start the server\n    ```\n    npm start\n    ```\n6. (Optional) If you're running the project locally, you'll probably have to use a proxy service (like [https://ngrok.com/](ngrok)) to expose it to Stytch.\n\nYou can now check the logs to see if the webhooks are being received and processed correctly. Stytch platform provide a test button to trigger the webhooks for testing.\n\n## Supported Flows\nThe project is currently supported by the following flows to sync users (with roles) and tenants to Permit.\n\n\u003e The project utilizes the query parameters of the webhooks to pass configuration for the flows.\n\n### Sync User\nThis hook gets the user from Stych and creating/updating it in Permit.\n\n#### Webhook URL\n```\nhttps://{YOUR_SERVER_URL}/sync-users{optional_query_parameters}\n```\n\n#### Supported Stytch events\n* `*.user.create` - A new user has been created in Stytch\n* `*.user.update` - An existing user has been updated in Stytch\n\n#### Optional Params\n* `role_assignment = default | tenant` - if set will assign the role to a user. In case of `tenant` the assignment will be done to the organization of the user.\n* `create_roles = true` - if set to true, it will create the roles if they do not exist.\n* `create_tenants = true` - if set to true, it will create the tenants if it does not exist.\n\n### Sync Tenant - TBD\n### Delete User - TBD\n### Delete Tenant - TBD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermitio%2Fpermit-stytch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpermitio%2Fpermit-stytch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpermitio%2Fpermit-stytch/lists"}