This repository includes all the code necessary to follow our latest Bulk update AI-generated meta fields tutorial.
No Storyblok account yet? Sign up now to experience a 14-day free trial of all features and enjoy the free Starter plan.
git clone https://github.com/storyblok/tutorial-bulk-update-ai-seo.gitnpm installRename the file .env.example to .env and provide the required credentials and variables (refer to the tutorial to learn where to find this information):
# Storyblok details
SB_MANAGEMENT_API_TOKEN=your_token_here
SB_SPACE_ID=12345
# Storyblok schema
SB_CONTENT_TYPE_BLOCK=blog_post
SB_AI_SEO_FIELD=sb_ai_seo
# AI API credentials
AI_API_URL=https://api.example.com/
AI_API_TOKEN=your_ai_token_here
AI_CUSTOM_PROMPT="Your_prompt_here"To regenerate and update SEO metadata for stories using AI, run:
# Test (recommended first)
npm run update -- --dry-run
# Perform the update
npm run updateHappy building!