{"id":13650614,"url":"https://github.com/formfcw/directus-extension-tokenized-preview","last_synced_at":"2026-01-11T23:01:16.900Z","repository":{"id":213425208,"uuid":"707658058","full_name":"formfcw/directus-extension-tokenized-preview","owner":"formfcw","description":"An endpoint that adds an active auth token to your preview URL","archived":false,"fork":false,"pushed_at":"2024-03-08T08:39:41.000Z","size":176,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T04:39:19.448Z","etag":null,"topics":["directus","directus-extension","directus-extension-endpoint","preview","token"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/directus-extension-tokenized-preview","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/formfcw.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}},"created_at":"2023-10-20T11:26:49.000Z","updated_at":"2025-04-30T16:47:02.000Z","dependencies_parsed_at":"2023-12-21T00:23:10.844Z","dependency_job_id":"ccc55739-f10d-45f0-a6d9-8810b2155a83","html_url":"https://github.com/formfcw/directus-extension-tokenized-preview","commit_stats":null,"previous_names":["formfcw/directus-extension-tokenized-preview"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/formfcw/directus-extension-tokenized-preview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formfcw%2Fdirectus-extension-tokenized-preview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formfcw%2Fdirectus-extension-tokenized-preview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formfcw%2Fdirectus-extension-tokenized-preview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formfcw%2Fdirectus-extension-tokenized-preview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/formfcw","download_url":"https://codeload.github.com/formfcw/directus-extension-tokenized-preview/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/formfcw%2Fdirectus-extension-tokenized-preview/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28326166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T22:11:01.104Z","status":"ssl_error","status_checked_at":"2026-01-11T22:10:58.990Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["directus","directus-extension","directus-extension-endpoint","preview","token"],"created_at":"2024-08-02T02:00:38.455Z","updated_at":"2026-01-11T23:01:16.871Z","avatar_url":"https://github.com/formfcw.png","language":"TypeScript","funding_links":[],"categories":["Extensions"],"sub_categories":["Community"],"readme":"# Tokenized Preview Endpoint for Directus\n\nAn endpoint that adds an active auth token to your preview URL. The auth token, which has a limited TTL, allows you to to preview content that is not publicly available through the API.\n\n## Installation\n\n-   [Official Guide](https://docs.directus.io/extensions/installing-extensions.html)\n-   [NPM Package](https://www.npmjs.com/package/directus-extension-tokenized-preview)\n\n## Usage\n\nPrefix the `Preview URL` of your data model collection with `/preview/`, like:\n\n`/preview/http://localhost:3000/posts/{{slug}}?preview=true`\n\n![](https://raw.githubusercontent.com/formfcw/directus-extension-tokenized-preview/main/docs/preview-url.png)\n\nOr if you set `TOKENIZED_PREVIEW_BASE_URL` (see below), you can achieve the same result without adding the base URL, like:\n\n`/preview/posts/{{slug}}?preview=true`\n\n![](https://raw.githubusercontent.com/formfcw/directus-extension-tokenized-preview/main/docs/preview-relative-url.png)\n\n### Result:\n\n```\nhttp://localhost:3000/posts/?preview=true\u0026token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjQ2ZjA1OGFjLTkyY2QtNDIzYi1hODgzLWU2OTQ5YTMxMjM2YiIsInJvbGUiOiJlMjgyOGMwYy05NzdkLTQzMzYtYjAyMy1hZTJhNGY5OTE1ZTIiLCJhcHBfYWNjZXNzIjoxLCJhZG1pbl9hY2Nlc3MiOjEsImlhdCI6MTY5Nzc5OTQ1MSwiZXhwIjoxNjk3ODAwMzUxLCJpc3MiOiJkaXJlY3R1cyJ9.qUme3vwuDTa9YNc9Ivewjvj2hThPT7t-6K7e_KO6QOU\n```\n\n## Config\n\nYou can configure the endpoint via ENV vars:\n\n```sh\n# The route of the endpoint. If it is `preview`, it will be `http://localhost:8055/preview`\n# Default: preview\nTOKENIZED_PREVIEW_ENDPOINT=preview\n```\n\n```sh\n# The key of the appended auth token. If it is `token`, it will append something like `?token=10932874539847`\n# Default: token\nTOKENIZED_PREVIEW_TOKEN_KEY=token\n```\n\n```sh\n# The base URL of your project (e.g. website).\nTOKENIZED_PREVIEW_BASE_URL=\n\n# If `TOKENIZED_PREVIEW_BASE_URL` is not set, it will use `PROJECT_URL`.\nPROJECT_URL=\n\n# If `PROJECT_URL` is not set, it will use `PUBLIC_URL`. If `PUBLIC_URL` is not set, it will use `http://localhost:8055`.\nPUBLIC_URL=\n```\n\n\u003e **Note:** You should add `PUBLIC_URL` to your ENV vars!\n\n\u003e **Note,** that for the preview feature to work, you should set the `CONTENT_SECURITY_POLICY_DIRECTIVES__FRAME_SRC` ENV var for the directus base URL (`PUBLIC_URL`) as well as for the preview base URL.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformfcw%2Fdirectus-extension-tokenized-preview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fformfcw%2Fdirectus-extension-tokenized-preview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fformfcw%2Fdirectus-extension-tokenized-preview/lists"}