{"id":28551387,"url":"https://github.com/iterable/sync-glean-with-slab","last_synced_at":"2025-07-05T20:31:23.578Z","repository":{"id":271462603,"uuid":"567841730","full_name":"Iterable/sync-glean-with-slab","owner":"Iterable","description":"Simple utility to get Slab content and index it in Glean","archived":false,"fork":false,"pushed_at":"2025-05-07T15:33:19.000Z","size":145,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-06-10T03:51:06.619Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Iterable.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}},"created_at":"2022-11-18T17:55:53.000Z","updated_at":"2025-05-07T15:33:21.000Z","dependencies_parsed_at":"2025-01-08T23:07:25.408Z","dependency_job_id":null,"html_url":"https://github.com/Iterable/sync-glean-with-slab","commit_stats":null,"previous_names":["iterable/sync-glean-with-slab"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Iterable/sync-glean-with-slab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iterable%2Fsync-glean-with-slab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iterable%2Fsync-glean-with-slab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iterable%2Fsync-glean-with-slab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iterable%2Fsync-glean-with-slab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Iterable","download_url":"https://codeload.github.com/Iterable/sync-glean-with-slab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iterable%2Fsync-glean-with-slab/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263801806,"owners_count":23513723,"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-06-10T03:38:59.538Z","updated_at":"2025-07-05T20:31:23.572Z","avatar_url":"https://github.com/Iterable.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Glean Indexing for Slab\n\nVery MVP type of tool to send Slab posts and users to Glean for indexing in their search. This will only work for organizations\nthat have a Business or Enterprise plan with Slab as their API is gated behind those plans.\n\n## Scripts\n\n- `yarn install`\n- `yarn build`: Build executable version\n- `yarn start`: Run executable version\n- `yarn dev`: Runs `build` and `start` for you\n\n## Configuration\n\nAll configuration is done by environment variables:\n\n- `SLAB_WORKSPACE` = The Slab workspace subdomain (e.g. `mycompany` if the URL is `https://mycompany.slab.com`)\n- `SLAB_TOKEN` = A Slab API token from [Developer Settings](https://slab.com/app/admin/developer)\n- `GLEAN_WORKSPACE` = The Glean API subdomain (e.g. `mycompany` if the API URL is `https://mycompany.glean.com`)\n- `GLEAN_TOKEN` = A Glean API token from the [Admin Console](https://app.glean.com/admin/setup/tokenManagement)\n- `BETA_USERS` = A comma-separated list of Glean users that can access the test data source\n- `CREATE_DATASOURCE` = Toggles the process to create or update the datasource in Glean (default is true)\n- `SYNC_USERS` = Toggles the process to index users for the datasource in Glean (default is true)\n- `SYNC_POSTS` = Toggles the process to index posts for the datasource in Glean (default is true)\n- `GET_DOCS_COUNT` = Toggles the process to return a count of documents for the datasource in Glean (default is true)\n- `IS_TEST` = Toggle whether the datasource during the run is a private test version or the generally available one (default is false)\n- `FORCE_REUPLOAD` = Toggle whether Glean should `forceRestartUpload` while processing posts (default is false)\n- `BATCH_SIZE` = Glean API batch size for bulk indexing posts (default is 100)\n\n## How It Works\n\nOn execution, this will optionally:\n\n1. Create a Datasource in Glean\n2. Re-index users in Slab to Glean\n3. Re-index posts in Slab to Glean\n4. Return a count of processed documents in the Glean datasource\n\n### Datasource\n\nEnabled using the `CREATE_DATASOURCE` environment variable.\n\nThis creates or updates a `Slab` Datasource in Glean. \n\nIf `IS_TEST` environment variable is true, the datasource affected will be a test version and only email addresses \nidentified in the `BETA_USERS` environment variable will have access to it.\n\n### Reindex Users\n\nEnabled using the `SYNC_USERS` environment variable.\n\nThis fetches all user accounts on Slab and sends them for bulk indexing in Glean for the Slab datasource.\n\n### Reindex Posts\n\nEnabled using the `SYNC_POSTS` environment variable.\n\nThis will pull all posts from Slab, filter unpublished posts, then submit them to Glean for bulk indexing.\n\n\n### Additional Documentation\n\n- [Slab GraphQL API](https://studio.apollographql.com/public/Slab/variant/current/home)\n- [Glean Indexing API](https://developers.glean.com/indexing/overview/#section/Introduction)\n\n## Requirements\n\n- Node 16+\n- Ensure environment variables are set up (either copy `.env.example` to `.env` and fill it out or provide envvars some other way)\n\n\nCopyright 2023 Iterable, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiterable%2Fsync-glean-with-slab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiterable%2Fsync-glean-with-slab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiterable%2Fsync-glean-with-slab/lists"}