- Node.js v22+
- PNPM v10+
- An account on Twilio Segment with configured source.
Important
You can use the devcontainer Dockerfile and docker-compose.yaml directly - but remember to run pnpm install and pnpm setup-dynamodb manually
The easiest way to run Saleor for local development is to use development containers. If you have Visual Studio Code, follow their guide on how to open an existing folder in a container.
The development container only creates a container; you still need to start the server.
The development container will have two ports opened:
3000- where the app dev server will listen for requests8000- where the local DynamoDB will listen for requests and allow NoSQL Workbench for DynamoDB to connect
- Install the dependencies by running the following command in the shell:
pnpm install-
Create a file named
.envand use the contents of the.env.examplefile as a reference. -
Start the development server by running the following command in the shell:
pnpm dev- App will be available under
http://localhost:3000
Note
To install app in Saleor Cloud, you need to expose your local server to the internet (tunnel). You can use Saleor CLI to do that. See this guide for more details.
- Install app on the Saleor dashboard.
- After installation, configure the app as follows:
- Paste
writeKeyinto app configuration form
- Paste
Note
This section refers to apps hosted by Saleor or using REST APL. If you self host AvaTax app you need to write your own logic for updating migration scripts. See [How to update app webhooks](https://docs.saleor.io/developer/extending/apps/updating-app-webhooks for more info.
You need to set REST_APL_TOKEN & REST_APL_ENDPOINT in our .env file first.
Test migration with dry run, operation will not modify any data:
pnpm migrate:dry-runTo start the migration run command:
pnpm migrateSegment app uses DynamoDB as it's internal database.
In order to work properly you need to either set-up local DynamoDB instance or connect to a real DynamoDB on AWS account.
To use a local DynamoDB instance you can use Docker Compose:
docker compose upAfter that a local DynamoDB instance will be spun-up at http://localhost:8000.
To set up tables needed for the app run following command for each table used in app:
pnpm setup-dynamodbAfter setting up database, you must configure following variables:
DYNAMODB_MAIN_TABLE_NAME=segment-main-table
AWS_REGION=localhost
AWS_ENDPOINT_URL=http://localhost:8000
AWS_ACCESS_KEY_ID=fake_id
AWS_SECRET_ACCESS_KEY=fake_keyLocal instance doesn't require providing any authentication details.
To see data stored by the app you can use NoSQL Workbench app provided by AWS. After installing the app go to Operation builder > Add connection > DynamoDB local and use the default values.
To configure DynamoDB for production usage, provide credentials in a default AWS SDK format (see AWS Docs)
DYNAMODB_MAIN_TABLE_NAME=segment-main-table
AWS_REGION=us-east-1 # Region when DynamoDB was deployed
AWS_ACCESS_KEY_ID=AK...
AWS_SECRET_ACCESS_KEY=...Visit @saleor/apps-otel README to learn how to run app with OTEL locally.