The following is a guide to launching a Svelte TakeShape project that injects Ecommerce data into your components.
Follow our documentation to create a read-only API Key.
Find your API Endpoint by navigating to your project in the TakeShape web client and clicking on the Home tab. Scroll down, and you'll see your API Endpoint in the Useful Snippets
section on the bottom right. Refer to the image below:
In the terminal on your local machine, clone this repo with git clone https://github.com/takeshape/takeshape-starter-svelte.
Open the project in your favorite IDE or change directories into it with your terminal.
Edit .env.local-example
in the src
directory and replace the text that says YOUR-ENDPOINT-HERE
with your API Endpoint. Replace the text that says YOUR-API-KEY-HERE
with your API Key. Rename the file to .env
.
Run npm install
and then npm run dev
in your terminal.
Check out our docs on this project to learn how this example works.