Skip to content

Commit 51c9411

Browse files
chore(seo): improve discoverability across npm, GitHub, and search engines (#11)
- Point homepage to docs site for npm canonical link - Add 10 keywords to package.json (nuxt3, nuxt4, vue3, typescript, etc.) - Add 8 GitHub topics for search visibility - Add "Why nuxt-safe-action?" section and comparison table to README - Add TypeScript badge to README - Expand Open Graph and Twitter Card meta on docs landing page - Add site.url for proper sitemap and canonical tag generation - Add robots.txt with sitemap reference - Enrich all docs page descriptions for better meta tags
1 parent 732450f commit 51c9411

16 files changed

Lines changed: 54 additions & 12 deletions

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
[![npm downloads](https://img.shields.io/npm/dm/nuxt-safe-action.svg?style=flat&colorA=020420&colorB=00DC82)](https://npm.chart.dev/nuxt-safe-action)
99
[![License](https://img.shields.io/npm/l/nuxt-safe-action.svg?style=flat&colorA=020420&colorB=00DC82)](https://npmjs.com/package/nuxt-safe-action)
1010
[![Nuxt](https://img.shields.io/badge/Nuxt-020420?logo=nuxt)](https://nuxt.com)
11+
[![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
1112

1213
Type-safe server actions for Nuxt.
1314

@@ -47,6 +48,21 @@ const { execute, data, status, validationErrors } = useAction(createPost)
4748
- **H3Event access** - Full request context available in middleware and handlers
4849
- **Nuxt-native** - Auto-imports, familiar conventions, works out of the box
4950

51+
## Why nuxt-safe-action?
52+
53+
Calling server endpoints with raw `$fetch` is untyped, error-prone, and forces you to manually handle validation, error formatting, and loading states. `nuxt-safe-action` gives you a declarative builder that validates input with Zod, chains middleware for auth and logging, and returns reactive state on the client, all with full end-to-end type inference. It works with Nuxt 3 and Nuxt 4, supports both Zod v3 and v4, and adds minimal bundle overhead.
54+
55+
### Comparison
56+
57+
| | `$fetch` | tRPC-nuxt | **nuxt-safe-action** |
58+
|---|---|---|---|
59+
| Type safety | manual | full | full |
60+
| Input validation | manual | via zod | built-in zod |
61+
| Middleware | manual | via context | composable chain |
62+
| File-based routing | N/A | no | auto-generated |
63+
| Vue composable | no | no | `useAction` |
64+
| Bundle overhead | none | heavy | minimal |
65+
5066
## Quick Setup
5167

5268
Install the module:

docs/app/pages/index.vue

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ useSeoMeta({
99
title: 'nuxt-safe-action',
1010
description:
1111
'Type-safe server actions for Nuxt. Define actions with Zod validation and middleware, call them from the client with full type inference.',
12+
ogTitle: 'nuxt-safe-action - Type-safe Server Actions for Nuxt',
13+
ogDescription:
14+
'Define server actions with Zod validation and composable middleware. Call them from Vue components with full type inference, reactive status tracking, and field-level validation errors.',
15+
ogType: 'website',
16+
ogUrl: 'https://nuxt-safe-action.vercel.app',
1217
ogImage: '/social-card.png',
18+
twitterCard: 'summary_large_image',
19+
twitterTitle: 'nuxt-safe-action - Type-safe Server Actions for Nuxt',
20+
twitterDescription:
21+
'Define server actions with Zod validation and composable middleware. Call them from Vue components with full type inference, reactive status tracking, and field-level validation errors.',
22+
twitterImage: 'https://nuxt-safe-action.vercel.app/social-card.png',
1323
})
1424
1525
const copied = ref(false)

docs/content/1.getting-started/1.installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Installation
3-
description: Get started with nuxt-safe-action in under a minute.
3+
description: Install nuxt-safe-action, the type-safe server action module for Nuxt 3 and Nuxt 4 with Zod v3 and v4 support.
44
---
55

66
# Installation

docs/content/1.getting-started/2.usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Usage
3-
description: Learn the three steps to using nuxt-safe-action.
3+
description: Learn how to create a type-safe action client, define validated server actions, and call them from Vue components with useAction.
44
---
55

66
# Usage

docs/content/2.guide/1.action-client.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Action Client
3-
description: Create and configure your action client with error handling and middleware.
3+
description: Create and configure the nuxt-safe-action client with custom error handling, authentication middleware, and role-based access control.
44
---
55

66
# Action Client

docs/content/2.guide/2.defining-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Defining Actions
3-
description: Learn how to define server actions with validation and handlers.
3+
description: Define type-safe server actions with Zod input and output validation, file-based routing, HTTP method suffixes, and metadata.
44
---
55

66
# Defining Actions

docs/content/2.guide/3.use-action.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: useAction
3-
description: The reactive composable for executing server actions in your components.
3+
description: useAction is a Vue composable for executing type-safe server actions with reactive status, validation errors, and lifecycle callbacks.
44
---
55

66
# useAction

docs/content/2.guide/4.middleware.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Middleware
3-
description: Chain middleware for auth, logging, and more with typed context.
3+
description: Chain composable middleware for authentication, authorization, logging, and rate limiting with fully typed context and H3Event access.
44
---
55

66
# Middleware

docs/content/2.guide/5.error-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Error Handling
3-
description: Handle server errors and return field-level validation errors.
3+
description: Handle server errors with ActionError and return field-level Zod validation errors to Vue components using nuxt-safe-action.
44
---
55

66
# Error Handling

docs/content/3.api/1.create-safe-action-client.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: createSafeActionClient
3-
description: API reference for creating a safe action client.
3+
description: API reference for createSafeActionClient — configure error handling, middleware, and create reusable type-safe action clients for Nuxt.
44
---
55

66
# createSafeActionClient

0 commit comments

Comments
 (0)