postonsundays
postonsundays
PD🧩 Plasmo Developers
Created by postonsundays on 4/1/2024 in #👾extension
command bar modal w. CSUI
No description
2 replies
PD🧩 Plasmo Developers
Created by postonsundays on 11/6/2023 in #👾extension
Combining css from multiple packages in CSUI
Having some trouble getting the https://github.com/onesine/react-tailwindcss-select component working in CSUI container. I'm also using tailwind CSS and not sure what the best way to combine CSS imports is from the top level?
import cssText from 'data-text:~style.css';
import selectCSS from 'react-tailwindcss-select/dist/index.css';

export const getStyle = () => {
const style = document.createElement("style")
let css = cssText
// css += dropStyle
css += selectCSS

style.textContent = css
return style
}
import cssText from 'data-text:~style.css';
import selectCSS from 'react-tailwindcss-select/dist/index.css';

export const getStyle = () => {
const style = document.createElement("style")
let css = cssText
// css += dropStyle
css += selectCSS

style.textContent = css
return style
}
2 replies
PD🧩 Plasmo Developers
Created by postonsundays on 10/28/2023 in #🔰newbie
accessing stripe in CSUI
I'm trying to mount a content panel that checks if the user is on a paid subscription before accessing certain page details. I've got auth working, but not a way to check the Stripe API (following the dangers of injecting script direct to browser like this tutorial mentions) https://www.propelauth.com/post/chrome-extension-authentication-with-plasmo the with-stripe example on Github only works in the popup, I'm now trying to get the customer info by email from a background script using sendToBackground but it hangs after logging the email. any tips?
import type { PlasmoMessaging } from "@plasmohq/messaging"
import Stripe from 'stripe';

const stripe = new Stripe(process.env.STRIPE_PRIVATE_KEY, {
apiVersion: "2023-08-16"
})

const handler: PlasmoMessaging.MessageHandler = async (req, res) => {

let email = req.body.email


console.log('_log email', email)


const c = await stripe.customers.list({
email,
limit: 10
})


console.log('_log c', c)


return c
}

export default handler
import type { PlasmoMessaging } from "@plasmohq/messaging"
import Stripe from 'stripe';

const stripe = new Stripe(process.env.STRIPE_PRIVATE_KEY, {
apiVersion: "2023-08-16"
})

const handler: PlasmoMessaging.MessageHandler = async (req, res) => {

let email = req.body.email


console.log('_log email', email)


const c = await stripe.customers.list({
email,
limit: 10
})


console.log('_log c', c)


return c
}

export default handler
3 replies