This example demonstrates how to programmatically import assets from a URL using the Asset Upload endpoint. Uses Bee-Queue to process jobs (recommended for large data imports).
Included is an example JSON file (assets.json
).
npx degit graphcms/graphcms-examples/using-asset-upload using-asset-upload
Add .env:
cp .env.sample .env
Provide values for GRAPHCMS_TOKEN
and GRAPHCMS_ENDPOINT
keys.
Install & Run:
cd using-asset-upload
npm install
npm run start assets.json
# or
cd using-asset-upload
yarn
yarn start assets.json