{"connections":[{"id":"atlas-admin-sdk","title":"Atlas Admin API client (TypeScript)","kind":"sdk","language":"typescript","description":"Use the Atlas Digest authentication client (atlas-api-client) pointed at the emulator base URL.","template":"import { AtlasClient } from \"atlas-api-client\";\n\nconst client = new AtlasClient({\n  baseUrl: \"{{baseUrl}}/api/atlas/v2\",\n  publicKey: \"{{clientId}}\",\n  privateKey: \"{{clientSecret}}\",\n});","body":"import { AtlasClient } from \"atlas-api-client\";\n\nconst client = new AtlasClient({\n  baseUrl: \"https://mongoatlas.your-instance.emulators.dev/api/atlas/v2\",\n  publicKey: \"<client_id>\",\n  privateKey: \"<client_secret>\",\n});"},{"id":"data-api-fetch","title":"Atlas Data API (fetch)","kind":"sdk","language":"typescript","description":"The Atlas Data API is a plain HTTPS surface; call it with fetch against the emulator base URL.","template":"const res = await fetch(\"{{baseUrl}}/app/data-api/v1/action/findOne\", {\n  method: \"POST\",\n  headers: {\n    \"content-type\": \"application/json\",\n    apiKey: \"{{token}}\",\n  },\n  body: JSON.stringify({\n    dataSource: \"Cluster0\",\n    database: \"test\",\n    collection: \"items\",\n    filter: {},\n  }),\n});\nconst { document } = await res.json();","body":"const res = await fetch(\"https://mongoatlas.your-instance.emulators.dev/app/data-api/v1/action/findOne\", {\n  method: \"POST\",\n  headers: {\n    \"content-type\": \"application/json\",\n    apiKey: \"<token>\",\n  },\n  body: JSON.stringify({\n    dataSource: \"Cluster0\",\n    database: \"test\",\n    collection: \"items\",\n    filter: {},\n  }),\n});\nconst { document } = await res.json();"},{"id":"atlas-env","title":"Atlas base URL (env)","kind":"env","language":"bash","description":"Point your Atlas client or scripts at the emulator instead of cloud.mongodb.com.","template":"MONGODB_ATLAS_BASE_URL={{baseUrl}}\nMONGODB_ATLAS_API_KEY={{token}}","body":"MONGODB_ATLAS_BASE_URL=https://mongoatlas.your-instance.emulators.dev\nMONGODB_ATLAS_API_KEY=<token>"},{"id":"curl-admin","title":"curl (Admin API)","kind":"curl","language":"bash","description":"List projects via the Atlas Administration API.","template":"curl -s {{baseUrl}}/api/atlas/v2/groups -H \"authorization: Bearer {{token}}\"","body":"curl -s https://mongoatlas.your-instance.emulators.dev/api/atlas/v2/groups -H \"authorization: Bearer <token>\""},{"id":"curl-data-api","title":"curl (Data API)","kind":"curl","language":"bash","description":"Find a document via the Atlas Data API.","template":"curl -s -X POST {{baseUrl}}/app/data-api/v1/action/findOne \\\n  -H \"content-type: application/json\" \\\n  -H \"apiKey: {{token}}\" \\\n  -d '{\"dataSource\":\"Cluster0\",\"database\":\"test\",\"collection\":\"items\",\"filter\":{}}'","body":"curl -s -X POST https://mongoatlas.your-instance.emulators.dev/app/data-api/v1/action/findOne \\\n  -H \"content-type: application/json\" \\\n  -H \"apiKey: <token>\" \\\n  -d '{\"dataSource\":\"Cluster0\",\"database\":\"test\",\"collection\":\"items\",\"filter\":{}}'"},{"id":"base-url","title":"Base URL (env)","kind":"env","language":"bash","description":"Point your SDK or app at the emulator instead of the real provider.","template":"{{SERVICE_UPPER}}_BASE_URL={{baseUrl}}","body":"MONGOATLAS_BASE_URL=https://mongoatlas.your-instance.emulators.dev"},{"id":"create-credential","title":"Create a credential","kind":"curl","language":"bash","description":"Mint a working credential for this instance.","template":"curl -s -X POST {{controlBaseUrl}}/credentials \\\n  -H \"content-type: application/json\" \\\n  -d '{\"type\":\"{{defaultAuthType}}\"}'","body":"curl -s -X POST https://mongoatlas.your-instance.emulators.dev/_emulate/credentials \\\n  -H \"content-type: application/json\" \\\n  -d '{\"type\":\"api-key\"}'"},{"id":"inspect-ledger","title":"Inspect requests","kind":"curl","language":"bash","description":"Read the request ledger to validate how your app called the service.","template":"curl -s {{controlBaseUrl}}/ledger","body":"curl -s https://mongoatlas.your-instance.emulators.dev/_emulate/ledger"}]}