Skip to content

Vue Adapter API

Terminal window
npm install @rep-protocol/vue @rep-protocol/sdk
function useRep(key: string, defaultValue?: string): Ref<string | undefined>;

Reads a PUBLIC tier variable as a reactive Ref.

ParameterTypeDescription
keystringVariable name
defaultValuestringOptional fallback value

Returns: Ref<string | undefined>

Behavior:

  • Set immediately from the injected payload
  • Subscribes to hot reload on creation
  • Unsubscribes via onUnmounted
  • Must be called inside setup()
function useRepSecure(key: string): Ref<string | null>;

Reads a SENSITIVE tier variable as a reactive Ref.

ParameterTypeDescription
keystringVariable name

Returns: Ref<string | null>

Behavior:

  • Starts as null
  • Resolves after session key fetch and decryption
  • Errors are swallowed (SDK logs them); ref stays null
  • Does not subscribe to hot reload
  • Vue >= 3.0
  • @rep-protocol/sdk peer dependency
  • Must be called from setup() for onUnmounted cleanup