Stay organized with collections
Save and categorize content based on your preferences.
While you can accomplish all connector-related tasks using the online Apps
Script environment, some of them can become repetitive and error-prone over
time.
dscc-gen is an opinionated tool that's meant to address these repetitive
tasks so you can focus on solving your business problem instead of errors that
can be avoided through automation.
dscc-gen can also be used with existing projects. First,
copy your scriptId, then run the following command (replacing
YOUR_SCRIPT_ID with your scriptId.):
You'll be prompted for a few details for your connector. If you don't already
have a deployment called "Production", one will be created for you. None of your
existing code will be modified, but you will have access to
everything dscc-gen can do.
New connectors
To create a new community-connector with dscc-gen, run the following command:
npx@google/dscc-genconnector
You'll be prompted for a few details for your new connector. First-time users
will be asked to authenticate clasp. clasp is a tool for creating &
modifying Apps Script projects from the command-line.
After completing the prompts, dscc-gen will create a new Apps Script project
and print out everything it can do.
What can dscc-gen do?
Command
Description
npm run open
Open your project in Apps Script.
npm run push
Push your local changes to Apps Script.
npm run watch
Watch for local changes, and push them to Apps
Script.
npm run prettier
Format your code using community standards.
npm run try_latest
Open the deployment with your latest code in
Looker Studio.
npm run try_production
Open your Production deployment in Looker
Studio.
npm run update_production
Update your production deployment to use your
latest code.
How should I Use it?
Using dscc-gen often goes a little like this:
Identify a feature you'd like to add to your connector.
Run npm run watch, so local changes will be pushed to Apps Script.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003e\u003ccode\u003edscc-gen\u003c/code\u003e is a tool that automates repetitive tasks in creating and managing Data Studio community connectors.\u003c/p\u003e\n"],["\u003cp\u003eIt simplifies connector development by providing commands to create projects, push code updates, and deploy to Looker Studio.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use \u003ccode\u003edscc-gen\u003c/code\u003e with existing connectors or create new ones from scratch, streamlining their workflow.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003edscc-gen\u003c/code\u003e utilizes \u003ccode\u003eclasp\u003c/code\u003e for command-line interaction with Apps Script projects and provides various helpful commands like \u003ccode\u003enpm run watch\u003c/code\u003e, \u003ccode\u003enpm run try_latest\u003c/code\u003e, and \u003ccode\u003enpm run update_production\u003c/code\u003e for efficient development and deployment.\u003c/p\u003e\n"],["\u003cp\u003eTo get started with an existing connector, you need to obtain the \u003ccode\u003escriptId\u003c/code\u003e from the Apps Script project URL.\u003c/p\u003e\n"]]],[],null,["# Local development\n\nWhile you can accomplish all connector-related tasks using the online Apps\nScript environment, some of them can become repetitive and error-prone over\ntime.\n\n[`dscc-gen`](https://github.com/googledatastudio/dscc-gen) is an opinionated tool that's meant to address these repetitive\ntasks so you can focus on solving your business problem instead of errors that\ncan be avoided through automation.\n\nRequirements\n------------\n\n- [npm 5.2.0 or later](https://www.npmjs.com/get-npm)\n- Some familiarity with the command-line.\n\nUsing `dscc-gen`\n----------------\n\n`dscc-gen` can [create new community-connector projects](#new_connectors) or be\n[used with existing ones](#existing_connectors).\n\n### Existing connectors\n\n`dscc-gen` can also be used with existing projects. First,\n[copy your `scriptId`](#get_your_script_id), then run the following command (replacing\n`YOUR_SCRIPT_ID` with your `scriptId`.): \n\n npx @google/dscc-gen connector --script_id YOUR_SCRIPT_ID\n\nYou'll be prompted for a few details for your connector. If you don't already\nhave a deployment called \"Production\", one will be created for you. None of your\nexisting code will be modified, but you will have access to\n[everything `dscc-gen` can do](#what_can_dscc-gen_do).\n\n### New connectors\n\nTo create a new community-connector with `dscc-gen`, run the following command: \n\n npx @google/dscc-gen connector\n\n| **Note:** [npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) was added to npm 5.2.0. It runs one-off executables without modifying your `PATH`.\n\nYou'll be prompted for a few details for your new connector. First-time users\nwill be asked to authenticate `clasp`. [`clasp`](/apps-script/guides/clasp) is a tool for creating \\&\nmodifying Apps Script projects from the command-line.\n\nAfter completing the prompts, `dscc-gen` will create a new Apps Script project\nand print out [everything it can do](#what_can_dscc-gen_do).\n\nWhat can `dscc-gen` do?\n-----------------------\n\n| Command | Description |\n|-----------------------------|-------------------------------------------------------------|\n| `npm run open` | Open your project in Apps Script. |\n| `npm run push` | Push your local changes to Apps Script. |\n| `npm run watch` | Watch for local changes, and push them to Apps Script. |\n| `npm run prettier` | Format your code using community standards. |\n| `npm run try_latest` | Open the deployment with your latest code in Looker Studio. |\n| `npm run try_production` | Open your Production deployment in Looker Studio. |\n| `npm run update_production` | Update your production deployment to use your latest code. |\n\n| **Note:** All of these commands should be run from the top-level directory of your project.\n\nHow should I Use it?\n--------------------\n\nUsing `dscc-gen` often goes a little like this:\n\n1. Identify a feature you'd like to add to your connector.\n2. Run `npm run watch`, so local changes will be pushed to Apps Script.\n3. Make your code changes using your [favorite](https://code.visualstudio.com/) [JavaScript](https://www.sublimetext.com/) [editor](http://spacemacs.org/).\n4. Run `npm run tryLatest` and check that your new feature is working as expected.\n5. Run `npm run updateProduction` to update your production deployment to have your new feature.\n6. Run `npm run tryProduction` and double check that the new feature works.\n\nGet your script Id\n------------------\n\nTo get your `scriptId`, navigate to your existing project, then copy the section\nof the url after `/d/` and before `/edit`. For example: the following url:\n\n- Original Url: `https://script.google.com/a/google.com/d/example-script-id/edit`\n- Script Id: `example-script-id`"]]