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

@rep-protocol/vue

v0.1.7

Published

Vue adapter for the Runtime Environment Protocol (REP).

Readme

@rep-protocol/vue

Vue composables for the Runtime Environment Protocol.

Provides useRep() and useRepSecure() composables that expose REP environment variables as reactive refs. Hot-reload updates are reflected automatically; subscriptions are cleaned up on unmount.

Install

npm install @rep-protocol/vue @rep-protocol/sdk

Usage

<script setup lang="ts">
import { useRep, useRepSecure } from '@rep-protocol/vue';

// PUBLIC tier — synchronous, immediate, reactive.
const apiUrl = useRep('API_URL', 'http://localhost:3000');
const flags = useRep('FEATURE_FLAGS', '');

// SENSITIVE tier — async, resolves after session key fetch.
const analyticsKey = useRepSecure('ANALYTICS_KEY');
</script>

<template>
  <div>
    <p>API: {{ apiUrl }}</p>
    <p>Analytics: {{ analyticsKey ?? 'loading…' }}</p>
  </div>
</template>

API

useRep(key, defaultValue?)

Reads a PUBLIC tier variable as a reactive Ref. Synchronous initial value.

const value: Ref<string | undefined> = useRep('API_URL');
const value: Ref<string | undefined> = useRep('API_URL', 'fallback');
  • Returns a Ref that is set immediately to the value from the injected REP payload.
  • Returns defaultValue (or undefined) if the variable is not present.
  • Automatically updates when the variable changes via hot reload.
  • Unsubscribes from hot reload in onUnmounted — must be called inside setup().

useRepSecure(key)

Reads a SENSITIVE tier variable as a reactive Ref. Resolves asynchronously.

const analyticsKey: Ref<string | null> = useRepSecure('ANALYTICS_KEY');
  • Starts as null.
  • Sets the ref value once the session key fetch and decryption complete.
  • The decrypted value is cached by the SDK for the page lifetime.
  • Errors are swallowed silently (the SDK logs them); the ref stays null.

Hot Reload

useRep subscribes to the REP gateway's SSE stream on mount and updates the ref value automatically when config changes. The subscription is cleaned up when the component unmounts.

useRepSecure does not subscribe to hot reload — sensitive variable changes require a page reload to re-derive a new session key.

Requirements

  • Vue ≥ 3.0
  • @rep-protocol/sdk as a peer dependency
  • Composables must be called from a component's setup() function (for onUnmounted cleanup)

Development Mode

Without the REP gateway, useRep() returns a ref with value undefined. Use defaultValue for local development:

const apiUrl = useRep('API_URL', 'http://localhost:3000');

Or inject a mock payload in your index.html:

<script id="__rep__" type="application/json">
{"public":{"API_URL":"http://localhost:3000"},"_meta":{"version":"0.1.0","injected_at":"2026-01-01T00:00:00Z","integrity":"hmac-sha256:dev","ttl":0}}
</script>

Specification

Implements REP-RFC-0001 §5.5 — Framework Adapters.

License

Apache 2.0