Skip to content

Commit

Permalink
NoJira: Use preview key in background function.
Browse files Browse the repository at this point in the history
  • Loading branch information
sherakama committed Oct 9, 2024
1 parent 0686382 commit 4bba0ae
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions netlify/functions/storyblok-background.mts
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,8 @@ const pingSlack = async (message: string) => {
*/
const fetchStory = async (storyID: string) => {
console.log('Fetching story:', storyID);
const context = process.env.CONTEXT;
let sbToken;
if (context === 'production') {
sbToken = process.env.PRODUCTION_STORYBLOK_ACCESS_TOKEN || process.env.STORYBLOK_ACCESS_TOKEN;
} else {
sbToken = process.env.STORYBLOK_ACCESS_TOKEN;
}
const sbToken = process.env.STORYBLOK_PREVIEW_EDITOR_TOKEN;

const sbConfig = {
accessToken: sbToken,
region: 'us'
Expand Down

0 comments on commit 4bba0ae

Please sign in to comment.