{"id":21826436,"url":"https://github.com/bkspace/shopify-script-tags","last_synced_at":"2025-08-18T10:10:01.239Z","repository":{"id":40763271,"uuid":"275395323","full_name":"bkspace/shopify-script-tags","owner":"bkspace","description":"A small library to inject script tags into Shopify storefront(s)","archived":false,"fork":false,"pushed_at":"2023-01-06T10:01:51.000Z","size":889,"stargazers_count":8,"open_issues_count":12,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-25T10:04:33.598Z","etag":null,"topics":["shopify","shopify-api","shopify-apps"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/bkspace.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":"2020-06-27T15:02:50.000Z","updated_at":"2023-05-10T21:43:55.000Z","dependencies_parsed_at":"2023-02-05T20:31:51.093Z","dependency_job_id":null,"html_url":"https://github.com/bkspace/shopify-script-tags","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/bkspace/shopify-script-tags","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkspace%2Fshopify-script-tags","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkspace%2Fshopify-script-tags/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkspace%2Fshopify-script-tags/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkspace%2Fshopify-script-tags/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bkspace","download_url":"https://codeload.github.com/bkspace/shopify-script-tags/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkspace%2Fshopify-script-tags/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270976284,"owners_count":24678466,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["shopify","shopify-api","shopify-apps"],"created_at":"2024-11-27T18:04:08.757Z","updated_at":"2025-08-18T10:10:01.206Z","avatar_url":"https://github.com/bkspace.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shopify-script-tags 📜\n\nA small library to inject script tags into Shopify storefront(s).\n\n## Info\n\nAll Shopify stores are built differently and asking users of your Shopify application to install custom UI components is not always feasible. One alternative is to inject a script tag `\u003cscript\u003estuffs\u003c/script\u003e` into the store front.\n\n### Requirements\n\nYou will require an access token with the `write_script_tags` scope included.\n\n### Where\n\nThis is ideally done when a Shopify store has authenticated with your application. For example, you will have the required shop context, access_token in your `afterAuth` hook when using `createShopifyAuth`.\n\n### Lifetime\n\nThe script tag will live on the storefront(s) for as long as said store is authenticated with your application. Once a store removes your application, the injected script tag is removed. Installed on application auth, removed on application removal..nice!\n\n## Usage\n\n```yarn install shopify-script-tags```\n\n```import { injectScript } from 'shopify-script-tags'```\n\n```\nawait injectScript(\n    fetch,\n    accessToken,\n    shop,\n    'https://example-url.com/script.js'\n)\n```\n\n```\nawait getScripts(\n    fetch,\n    accessToken,\n    shop,\n)\n```\n\n```\nawait deleteScript(\n    fetch,\n    accessToken,\n    shop,\n    '1234',\n)\n```\n\nThese function return a fetch response. It is left to the consumer to handle any possible errors. I expect this library will handle both fetch and a gql client in the near future.\n\nNote - you can add the same script multiple times, so injecting a script should be done once, or validate that the script being injected is different and/or versioned.\n\n## Development\n```yarn build```\n\n```yarn format```\n\n```yarn lint```\n\n```yarn test```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkspace%2Fshopify-script-tags","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkspace%2Fshopify-script-tags","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkspace%2Fshopify-script-tags/lists"}