Skip to content

Instantly share code, notes, and snippets.

View FlxRobole's full-sized avatar

FlxRobole

View GitHub Profile
@FlxRobole
FlxRobole / useSeo.ts
Last active November 4, 2025 14:56
Use @strapi/plugin-seo with nuxt
/**
* Simple `useSeo()` composable to connect API output of @strapi/plugin-seo with Nuxt 4.
*
* Usage example (using Nuxt Strapi - https://strapi.nuxtjs.org/usage#findone):
*
* const { findOne } = useStrapi();
* const response = await findOne<SingleTypePage>('restaurants', 'xyz', {
* populate: ['seo.openGraph.ogImage', 'seo.metaImage']
* });
* useSeo(response.data.seo);