Test and run locally
Map configuration to environment variables
Parameters in .port/spec.yaml become environment variables with this pattern:
- Port credentials:
OCEAN__PORT__CLIENT_ID,OCEAN__PORT__CLIENT_SECRET(and optionalOCEAN__PORT__BASE_URL). - Integration config:
OCEAN__INTEGRATION__CONFIG__<NAME_IN_UPPER_SNAKE_CASE>.
Example: apiBaseUrl in spec.yaml maps to OCEAN__INTEGRATION__CONFIG__API_BASE_URL.
.env
OCEAN__PORT__CLIENT_ID=<your-port-client-id>
OCEAN__PORT__CLIENT_SECRET=<your-port-client-secret>
OCEAN__INTEGRATION__CONFIG__API_BASE_URL=https://api.example.com
OCEAN__INTEGRATION__CONFIG__API_TOKEN=<your-token>
OCEAN__EVENT_LISTENER__TYPE=POLLING
Find Port credentials in Find your Port credentials.
Run the integration
cd ./my_integration
make install
source .venv/bin/activate
cp .env.example .env
# edit .env
make run
make run (or ocean sail) starts the integration, applies default resources when enabled, and begins listening for resync requests.
Trigger a resync
While the integration runs with POLLING (default):
- Open Connectors, select the integration, and click Resync.
- Or change the mapping or configuration in Port so the next poll detects a change.
See event listeners and resync triggers for scheduled resync and other listener types.
Debug
- Set
APPLICATION__LOG_LEVEL=DEBUGin.envfor verbose logs. - Use the scaffolded
debug.pywith your IDE debugger if needed.
Connection probe
To validate credentials and permissions without a full resync, implement @ocean.on_probe() and run ocean probe. See connection probe.