Nuxt Paypal

Introduction

A Nuxt module for simplifying the use of Paypal in your project.

Features

nuxt-mongoose
  • Easy Integration

Quick Setup

  1. Add nuxt-paypal dependency to your project
npx nuxi@latest module add paypal
  1. Add nuxt-paypal to the modules section of nuxt.config.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.

export default defineNuxtConfig({
  
  paypal: {
    clientId: 'your_client_id',
    // ...options
  },

})

Usage

nuxt-paypal has a usePaypalButton composable which you can see the usage here.

also you can find the paypal instance from nuxtApp as $paypal. example:

<script setup lang="ts">
const nuxt = useNuxtApp()

console.log(nuxt.$paypal?.version)
</script>