Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arashsheyda/nuxt-paypal
A Nuxt module for simplifying the use of Paypal in your project.
https://github.com/arashsheyda/nuxt-paypal
nuxt paypal
Last synced: 2 months ago
JSON representation
A Nuxt module for simplifying the use of Paypal in your project.
- Host: GitHub
- URL: https://github.com/arashsheyda/nuxt-paypal
- Owner: arashsheyda
- Created: 2023-11-05T17:58:48.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-03T19:36:04.000Z (9 months ago)
- Last Synced: 2024-10-30T09:36:54.394Z (2 months ago)
- Topics: nuxt, paypal
- Language: TypeScript
- Homepage: https://docs.arashsheyda.me/nuxt-paypal
- Size: 268 KB
- Stars: 13
- Watchers: 1
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Nuxt Paypal
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]A Nuxt module for simplifying the use of Paypal in your project.
- [β¨ Β Release Notes](/CHANGELOG.md)
- [π Online playground](https://stackblitz.com/github/arashsheyda/nuxt-paypal?file=playground%2Fapp.vue)## Features
- Easy Integration
## Quick Setup
1. Add `nuxt-paypal` dependency to your project
```bash
npx nuxi@latest module add paypal
```2. Add `nuxt-paypal` to the `modules` section of `nuxt.config.ts`
```ts
export default defineNuxtConfig({
modules: [
'nuxt-paypal',
],paypal: {
clientId: 'your_client_id',
},
})
```That's it! You can now use Nuxt Paypal in your Nuxt app β¨
## Configuration
just add `paypal` and configure it.
> By default `clientId` is configured to use the value of `PAYPAL_CLIENT_ID`. If no specific value is provided, it defaults to `test`.```ts
export default defineNuxtConfig({
paypal: {
clientId: 'your_client_id',
// ...options
},})
```## Usage
`nuxt-paypal` has a `usePaypalButton` composable which you can see [the usage here](https://github.com/arashsheyda/nuxt-paypal/blob/main/playground/app.vue).also you can find the paypal instance from nuxtApp as `$paypal`. example:
```vue
const nuxt = useNuxtApp()
console.log(nuxt.$paypal?.version)
```
## Development
```bash
# Install dependencies
npm install# Generate type stubs
npm run dev:prepare# Develop with the playground
npm run dev# Build the playground
npm run dev:build# Run ESLint
npm run lint# Run Vitest
npm run test
npm run test:watch# Release new version
npm run release
```[npm-version-src]: https://img.shields.io/npm/v/nuxt-paypal/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/nuxt-paypal[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-paypal.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-downloads-href]: https://npmjs.com/package/nuxt-paypal[license-src]: https://img.shields.io/npm/l/nuxt-paypal.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: https://npmjs.com/package/nuxt-paypal[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
[nuxt-href]: https://nuxt.com