npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@wetransform/vue

v1.1.0

Published

Vue 3 wrapper around `@wetransform/core` with a composable API and a component.

Downloads

266

Readme

@wetransform/vue

Vue 3 wrapper around @wetransform/core with a composable API and a component.

Installation

npm install @wetransform/vue

Component usage

<script setup lang="ts">
import { ref } from 'vue'
import { WeTransformSdk, type WeTransformConfig, type SupportedLocales } from '@wetransform/vue'

const isSdkOpen = ref(false)
const locale = ref<SupportedLocales>('en')

const config: WeTransformConfig = {
  organizationHandle: 'acme',
  authentication: {
    customerId: 'customer-id',
    signature: 'signed-token',
  },
}

const onSuccessSubmit = ({ redirectUrl }: { redirectUrl: string }) => {
  window.location.href = redirectUrl
}
</script>

<template>
  <button type="button" @click="isSdkOpen = true">Open Sender</button>
  <button type="button" @click="locale = locale === 'en' ? 'fr' : 'en'">Toggle locale</button>

  <WeTransformSdk
    :config="config"
    v-model:open="isSdkOpen"
    :locale="locale"
    :autoOpen="false"
    @successSubmit="onSuccessSubmit"
  />
</template>

WeTransformSdk is renderless except for its internal mount container and does not expose slots.

Props:

  • config (required): SDK configuration (excludes locale; use the locale prop instead)
  • open (optional): controlled open state (for v-model:open)
  • autoOpen (optional, default false): opens on mount
  • locale (optional): active locale ('en' | 'fr'); reactive — changing this prop calls setLocale on the SDK

Emits:

  • update:open
  • open
  • close
  • destroy
  • onReady
  • successSubmit
  • error

Composable usage

import { useWeTransform } from '@wetransform/vue'

const { open, close, destroy, setLocale, isOpen, weTransformInstance, on } = useWeTransform({
  organizationHandle: 'acme',
  authentication: {
    customerId: 'customer-id',
    signature: 'signed-token',
  },
})

on('successSubmit', ({ redirectUrl }) => {
  window.location.href = redirectUrl
})

await open()
await setLocale('fr')
await close()
await destroy()

console.log(isOpen.value)
console.log(weTransformInstance.value)

useWeTransform(config) returns:

  • weTransformInstance: readonly Ref<WeTransformInstance | null>
  • isOpen: readonly Ref<boolean>
  • open(): opens the SDK
  • close(): closes the SDK
  • destroy(): destroys the SDK instance (idempotent)
  • setLocale(locale): switches the locale ('en' | 'fr')
  • on(event, handler): subscribes to SDK events and returns an unsubscribe function

Re-exports

@wetransform/vue also re-exports these symbols from @wetransform/core:

  • createWeTransform
  • WeTransformConfig
  • WeTransformEventMap
  • WeTransformInstance
  • SupportedLocales

Notes

  • Wrapper lifecycle behavior forwards to core and does not modify core semantics.
  • config is used at instantiation time. For structural config changes, remount with a Vue :key.
  • The component forces the SDK mountElement internally; do not pass mountElement in config.
  • The locale prop (component) and setLocale (composable) can be called at any time, including before or while the SDK is open.