In `pages/`, export `getServerSideProps` as a standalone async function and return serializable props: ```tsx export async function getServerSideProps() { const posts = await postService.list() return { props: { posts } } } ``` Use `InferGetServerSidePropsType` for the page props. Call the service or database directly; do not fetch the app’s own API route from `getServerSideProps`.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Nextjs Pages Router?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-nextjs-pages-router-agent-skills-standard)
In `pages/`, export `getServerSideProps` as a standalone async function and return serializable props:
```tsx
export async function getServerSideProps() {
const posts = await postService.list()
return { props: { posts } }
}
```
Use `InferGetServerSidePropsType` for the page props. Call the service or database directly; do not fetch the app’s own API route from `getServerSideProps`.