--- url: https://developer-portal.gainsight.com/docs/custom-widgets/v2/first-script.md description: >- A hands-on tutorial that walks you through creating, registering, and publishing a global script from scratch --- # Your First Script In this tutorial, you will create a global script from scratch, register it in `extensions_registry.json`, and publish it to your community. By the end, you will have a script that runs on every page and logs a message to the browser console. ## Before You Start * You have a GitHub account. * You have access to Sources in your platform (**Integrations** → **Developer Studio** → **Sources**). * You have a connected GitHub organization — see [Connect Your GitHub Account](connect-github) if you haven't connected one yet. * You have a repository from the [template](https://github.com/gainsight-hub/widgets-repository-template), enabled in Sources with `main` as the watched branch — see [Repository Layout](project-setup) and [Repository & Branch Settings](repository-settings). ## Step 1: Create the Script File In your repository, create the directory `scripts/hello/` and inside it create `script.js` with this content: ```javascript console.log('Hello from your first global script!') ``` This is a plain JavaScript file — no module syntax, no SDK. Global scripts run directly in the page context, so anything you would write in a normal `