0.18.3 • Published 4 months ago

@gun-vue/composables v0.18.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Gun DB + Vue UI composables collection

A Composition API use functions set for Gun.js and Vue 3 reactivity system

@gun-vue composables logo

gun-vue.js.org

It's just the beginning and not all the functions are reliably implemented yet. So you're welcome to collaborate on existing and new features of the library.

  • User - the gun.user() system management
  • Account - user profile interface
  • Color - the color-hash interface to generate colors for hashes and pubs
  • Crypto - the main cryptographic primitives like e2e encrypted messaging and more
  • Date Tree - the very performant concept of Date Tree graphs from gun-util made reactive and easy to use
  • File - some bindings to manage file uploads and downloads
  • Hash - everything you need to hash data and work with the hashes in a reliable way (i.e. URL-safe conversion)
  • Mouse - some basic bindings to reliably locate mouse pointer in an SVG - may be useful for many online games
  • Password - some elaborations on reimagining password system in a p2p graph environment
  • Relay - Gun relay peer connection monitoring
  • Room - private signed collaborative spaces with a certificate system for access management. (TBD)
  • Space - a simple demo of showing working with private user data in a shared space
  • Posts - hashed immutable data in the root of the db as a fun experiment, but with deep observations about freedom of speach and ways to explore the vastness of the public graph space available with Gun
  • Chat - basic public chat
  • Rooms - cryptographic data collections
  • Dictionary - we find ourselves in great power if we have verified concepts to collaborate with

... and more!

And there's more!

READ FULL DOCUMENTATION ONLINE

How to use

  1. Install the library:
npm i @gun-vue/composables
  1. Import any of the functions you need:
import { useAccount } from "@gun-vue/composables";
  1. Instantiate the function inside your Vue SFC
const { account, auth, leave } = useAccount();
  1. Use the reactive state in your template to drive the component:
<div v-for="(data,field) in account.profile" :key="field">
	{{ field }} - {{ data }}
</div>

SSG environment notice (Nuxt, Vitepress etc.)

Gun-Vue is client-side only and it may throw errors being executed during the SSG/SSR build process. One way to deal with it is to make the your GUN-enabled components asynchronous.

1. Make your component async

<script setup async>
	const { useAccount } = await import("@gun-vue/composables");

	const { account } = useAccount();
</script>

<template>
	<div>{{ account.profile?.name }}</div>
</template>

2. Put it to load only on client side.

<ClientOnly>
	<Suspense>
		<YourComponent />
	</Suspense>
</ClientOnly>

This should prevent any Gun-Vue related code from running during build stage.

  • Refactor the code to be more useable and tree-shakeable in SSG environment. Help needed!

npm.io

0.18.3

4 months ago

0.18.2

6 months ago

0.17.3

1 year ago

0.17.0

1 year ago

0.17.1

1 year ago

0.18.1

12 months ago

0.18.0

12 months ago

0.14.3

1 year ago

0.14.4

1 year ago

0.15.0

1 year ago

0.15.1

1 year ago

0.15.2

1 year ago

0.16.10

1 year ago

0.16.3

1 year ago

0.16.4

1 year ago

0.16.5

1 year ago

0.16.6

1 year ago

0.16.7

1 year ago

0.16.8

1 year ago

0.16.9

1 year ago

0.16.0

1 year ago

0.16.1

1 year ago

0.16.2

1 year ago

0.13.0

1 year ago

0.13.1

1 year ago

0.13.2

1 year ago

0.12.10

1 year ago

0.14.0

1 year ago

0.14.1

1 year ago

0.14.2

1 year ago

0.12.7

1 year ago

0.12.8

1 year ago

0.12.9

1 year ago

0.12.6

1 year ago

0.11.8

1 year ago

0.11.6

1 year ago

0.11.7

1 year ago

0.12.0

1 year ago

0.12.1

1 year ago

0.12.3

1 year ago

0.12.4

1 year ago

0.12.5

1 year ago

0.11.0

2 years ago

0.11.1

2 years ago

0.11.2

2 years ago

0.11.4

2 years ago

0.11.5

2 years ago

0.9.4

2 years ago

0.10.1

2 years ago

0.10.2

2 years ago

0.10.3

2 years ago

0.10.0

2 years ago

0.9.3

2 years ago

0.9.0

2 years ago

0.9.1

2 years ago

0.7.6

2 years ago

0.7.8

2 years ago

0.7.7

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.8.2

2 years ago

0.5.10

2 years ago

0.6.6

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.3.0

2 years ago

0.7.2

2 years ago

0.5.4

2 years ago

0.7.1

2 years ago

0.3.5

2 years ago

0.7.4

2 years ago

0.5.6

2 years ago

0.3.8

2 years ago

0.7.3

2 years ago

0.5.5

2 years ago

0.3.7

2 years ago

0.5.0

2 years ago

0.3.1

2 years ago

0.7.0

2 years ago

0.3.4

2 years ago

0.5.1

2 years ago

0.5.8

2 years ago

0.7.5

2 years ago

0.5.7

2 years ago

0.3.9

2 years ago

0.5.9

2 years ago

0.3.10

2 years ago

0.6.3

2 years ago

0.2.7

2 years ago

0.6.2

2 years ago

0.2.6

2 years ago

0.6.5

2 years ago

0.2.9

2 years ago

0.6.4

2 years ago

0.2.8

2 years ago

0.2.3

2 years ago

0.4.0

2 years ago

0.2.5

2 years ago

0.6.0

2 years ago

0.2.4

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.15

2 years ago

0.1.14

2 years ago

0.1.13

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago