All Projects → mishushakov → signin-with-matrix

mishushakov / signin-with-matrix

Licence: MIT license
Federated sign-in component for your web app (using Matrix)

Programming Languages

Svelte
593 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to signin-with-matrix

Element Desktop
A glossy Matrix collaboration client for desktop.
Stars: ✭ 290 (+40.1%)
Mutual labels:  matrix, element
Matrix Dimension
An open source integration manager for matrix clients, like Element.
Stars: ✭ 277 (+33.82%)
Mutual labels:  matrix, element
radical
Element (Riot Web) unofficially bundled as Firefox Add-on
Stars: ✭ 33 (-84.06%)
Mutual labels:  matrix, element
RuoYi-Cloud-Vue3
🎉 基于Spring Boot、Spring Cloud & Alibaba、Vue3 & Vite、Element Plus的分布式前后端分离微服务架构权限管理系统
Stars: ✭ 295 (+42.51%)
Mutual labels:  element, vite
vite-plugin-sloth
Fresh take on static site generation, using HTML-first approach to build website. Powered by ⚡️ Vite
Stars: ✭ 39 (-81.16%)
Mutual labels:  webcomponents, vite
Element Web
element.io docker image generator
Stars: ✭ 21 (-89.86%)
Mutual labels:  matrix, element
botdarr
Slack/Discord/Telegram/Matrix bot for accessing radarr, sonarr, and lidarr
Stars: ✭ 76 (-63.29%)
Mutual labels:  matrix, element
Element Rpm
Providing the Element messaging desktop client packaged for the Fedora, Red Hat(IBM), and OpenSUSE families of linux desktop operating systems.
Stars: ✭ 73 (-64.73%)
Mutual labels:  matrix, element
Resize Observer
Polyfills the ResizeObserver API.
Stars: ✭ 540 (+160.87%)
Mutual labels:  webcomponents, element
vue-next-admin
🎉🎉🔥基于vue3.x 、Typescript、vite、Element plus等,适配手机、平板、pc 的后台开源免费模板库(vue2.x请切换vue-prev-admin分支)
Stars: ✭ 1,002 (+384.06%)
Mutual labels:  element, vite
vue-lite-admin
a lite vue3.0 admin template,there is no typescript and vuex (但注释挺全)
Stars: ✭ 67 (-67.63%)
Mutual labels:  vite
combining3Dmorphablemodels
Project Page of Combining 3D Morphable Models: A Large scale Face-and-Head Model - [CVPR 2019]
Stars: ✭ 80 (-61.35%)
Mutual labels:  matrix
RuoYi-Vue-Oracle
🎉 (RuoYi)官方仓库 基于SpringBoot,Spring Security,JWT,Vue & Element 的前后端分离权限管理系统
Stars: ✭ 225 (+8.7%)
Mutual labels:  element
preview-pro
Use pro-layout in vitejs. preview https://sendya.github.io/preview-pro/index.html
Stars: ✭ 71 (-65.7%)
Mutual labels:  vite
vite-plugin-restart
Custom files/globs to restart Vite server
Stars: ✭ 92 (-55.56%)
Mutual labels:  vite
vite-app-ios
Vite Official App for iOS
Stars: ✭ 40 (-80.68%)
Mutual labels:  vite
polytimer
polytimer.rocks
Stars: ✭ 24 (-88.41%)
Mutual labels:  webcomponents
tailwindcss
Add Tailwind CSS to your Svelte project
Stars: ✭ 583 (+181.64%)
Mutual labels:  vite
mongood
A MongoDB GUI with Fluent Design
Stars: ✭ 674 (+225.6%)
Mutual labels:  vite
vite-plugin-compile-time
Some compile-time magic for your Vite project
Stars: ✭ 94 (-54.59%)
Mutual labels:  vite

Sign in with Matrix

Screen.Recording.2021-11-12.at.05.51.57.mov

Over 35 million Matrix users can't wait to use your app. Use this pre-built component to make federated sign-in a no-effort zero-brainer

Before you do, please try a demo

Like it? Click on "Sponsor", so i can keep making this stuff!

Featured on This Week in Matrix

Cool stuff

  • Based on svelte, vite and typescript
  • Fully customisable and ready to use (even commercially)
  • Extremely lightweight
  • Framework-agnostic
  • Superior User-Interface and User-Experience
  • Secure, requires no backend to function
  • Fully accessible, compliant with WCAG Accessibility Guidelines
  • Compliant with Matrix 1.0 Protocol spec

Install

Browser

ES Module

<script defer src="https://unpkg.com/signin-with-matrix@latest/dist/index.es.js"></script>

UMD

<script defer src="https://unpkg.com/signin-with-matrix@latest/dist/index.umd.js"></script>

NPM

npm i signin-with-matrix

Import into your application with

import signIn from 'signin-with-matrix'

Use

Add the two components to your HTML

<matrix-signin id="signin"></matrix-signin>
<matrix-signin-button target="signin">
  Sign in with Matrix
</matrix-signin-button>
  • <matrix-signin> is the modal window
  • <matrix-signin-button> is a button which toggles the modal

Spec

<matrix-signin>

HTML attributes

  • displayName (String), name that will be displayed in Matrix
  • title (String), modal title
  • homeserver (String), default home server

Example

<matrix-signin
  displayName="My app"
  title="Use my app with Matrix"
  homeserver="matrix.org">
</matrix-signin>

Methods

  • open(), opens the modal
  • close(), closes the modal
  • cancel(), cancels the modal (will send cancel event)
  • isSignedIn(), checks if user is signed in
  • getUser(), returns current user, returns Promise
  • signOut(), sign out, returns Promise

Events

  • open, when modal opens
  • cancel, when modal is cancelled
  • success, when login has succeeded (with user object)
  • error, when error occurs (with error object)
  • signout, when user signs out

Example

Vanilla HTML + JS

<matrix-signin id="signin"></matrix-signin>
<script>
  const signIn = document.querySelector('matrix-signin')
  signIn.addEventListener('success', ({ detail }) => {
    console.log(detail.user)
  })
</script>

Vue

<template>
  <matrix-signin @success="notify"></matrix-signin>
</template>

<script>
export default {
  methods: {
    notify (user) {
      alert(JSON.stringify(user))
    }
  }
}
</script>

Styling

CSS variables available to style

--matrix-signin-shim-background
--matrix-signin-shim-blur
--matrix-signin-dialog-background
--matrix-signin-dialog-border-color
--matrix-signin-dialog-shadow
--matrix-signin-dialog-text-color
--matrix-signin-dialog-icon-color
--matrix-signin-dialog-hover-color
--matrix-signin-dialog-error-color
--matrix-signin-dialog-form-background
--matrix-signin-dialog-button-background
--matrix-signin-dialog-button-color

<matrix-signin-button>

HTML attributes

  • target (String), id of the target <matrix-signin> component

Example

<matrix-signin-button target="signin">
  Sign in with Matrix
</matrix-signin-button>

Development

  1. Clone the repository
git clone https://github.com/mishushakov/signin-with-matrix.git
  1. Install dependencies
npm i
  1. Start dev server
npm run dev
  1. Build
npm run build

Acknowledgements

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].