Skip to content

Commit 8763fa0

Browse files
committed
docs: simplify use of publishable keys
1 parent 526fcd1 commit 8763fa0

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

README.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,13 @@ npm i vue-stripe-js @stripe/stripe-js
3333
```vue
3434
<script setup lang="ts">
3535
import { onBeforeMount, ref } from "vue"
36-
import { loadStripe } from "@stripe/stripe-js"
37-
import type { Stripe } from "@stripe/stripe-js"
36+
import { loadStripe, type Stripe } from "@stripe/stripe-js"
3837
39-
const publishableKey = ref('')
38+
const publishableKey = '' // use your publishable key
4039
const stripe = ref<Stripe | null>(null)
4140
4241
onBeforeMount(async() => {
43-
stripe.value = await loadStripe(publishableKey.value)
42+
stripe.value = await loadStripe(publishableKey)
4443
})
4544
</script>
4645
```
@@ -91,7 +90,7 @@ import type {
9190
StripePaymentElementOptions,
9291
} from "@stripe/stripe-js"
9392
94-
const stripeKey = ref("pk_test_f3duw0VsAEM2TJFMtWQ90QAT")
93+
const stripeKey = "pk_test_f3duw0VsAEM2TJFMtWQ90QAT" // use your publishable key
9594
const stripeOptions = ref({
9695
// https://stripe.com/docs/js/initializing#init_stripe_js-options
9796
})
@@ -115,7 +114,7 @@ const elementsComponent = ref()
115114
const paymentComponent = ref()
116115
117116
onBeforeMount(() => {
118-
loadStripe(stripeKey.value).then(() => {
117+
loadStripe(stripeKey).then(() => {
119118
stripeLoaded.value = true
120119
121120
// Good place to call your backend to create PaymentIntent

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-stripe-js",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"description": "Vue 3 components for Stripe.js",
55
"type": "module",
66
"main": "./dist/vue-stripe.js",

0 commit comments

Comments
 (0)