Access Multiple DBs in CloudCode Tasks
Accessing Other Deployments
// Same app, different deployment
const otherDB = await CloudCode.createDB('https://{app-deployment-id}.backend.{region-code}.journeyapps.com/', '{backend-deployment-id}', {username: '{backend-deployment-id}', password: 'mypassword'});
const otherDB = await CloudCode.createDB('https://{app-deployment-id}.backend.{region-code}.journeyapps.com/', '{backend-deployment-id}', {token: 'mytoken'});
// Example
const otherDB = await CloudCode.createDB('https://62d541f4156bc4dd685318da.backend.us.journeyapps.com/', '62d541ff9f54b7000706c585', {token: 'mytoken'});
// Different app
const otherDB = await CloudCode.createRemoteDB('https://{app-deployment-id}.backend.{region-code}.journeyapps.com/', '{backend-deployment-id}', {username: '{backend-deployment-id}', password: 'mypassword'});
const otherDB = await CloudCode.createRemoteDB('https://{app-deployment-id}.backend.{region-code}.journeyapps.com/', '{backend-deployment-id}', {token: 'mytoken'});
// Example
const otherDB = await CloudCode.createRemoteDB('https://62d541f4156bc4dd685318da.backend.us.journeyapps.com/', '62d541ff9f54b7000706c585', {token: 'mytoken'});
Alternative: Accessing APIv4 directly
Last updated