I have a blog application in NextJS that takes the posts content from the Notion API. It works perfectly running on localhost, I make changes in Notion and they are loaded normally. But using the Vercel production deploy, the changes are not loaded when there are changes in Notion. What could be happening?
import { NotionDatabaseResponse } from "../_types/notion";
const notion = new Client({ auth: process.env.NOTION_API_KEY });
export async function getPosts() {
const databaseId = process.env.NOTION_DATABASE_ID || "";
const response = await notion.databases.query({
database_id: databaseId,
filter: {
or: [
{
property: "published",
checkbox: {
equals: true,
},
},
],
},
});
const typedResponse = (response as unknown) as NotionDatabaseResponse;
return typedResponse.results.map((post) => {
return {
id: post.id,
title: post.properties.title.title[0].plain_text,
slug: post.properties.slug.rich_text[0].plain_text,
tags: post.properties.tags.multi_select.map((tag) => tag.name),
createdAt: post.created_time,
};
})
}```
Github link: <https://github.com/ewrtonl/ewerton.dev>
I have no idea how to solve this problem and I tried deploying it directly through Vercel instead of committing it through Github and then deploying it, it didn't work either.`your text`