GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - BaseMax/liveblocks-javascript-authentication: A simple implementation of user authentication for Liveblocks using JavaScript. Liveblocks is a platform that enables real-time collaborative experiences in web applications. This example demonstrates how to authenticate users and manage access to rooms.

BranchesTags
Open more actions menu

Latest commit

 

History

63 Commits
63 Commits

Folders and files

NameName
Last commit message
Last commit date
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
auth.js
auth.js
 
 
composer.json
composer.json
 
 
composer.lock
composer.lock
 
 
index.html
index.html
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
room.js
room.js
 
 

Repository files navigation

Liveblocks JavaScript Authentication

This repository provides a simple implementation of user authentication for Liveblocks using JavaScript. Liveblocks is a platform that enables real-time collaborative experiences in web applications. This example demonstrates how to authenticate users and manage access to rooms.

Liveblocks JavaScript Authentication

https://liveblocks.io

Features

  • Generate unique user IDs for session management.
  • Manage user access to different rooms based on organization and group.
  • Simple integration with Liveblocks for real-time collaboration.
  • Example frontend and backend implementation.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Node.js installed on your machine (version 14 or later).
  • A Liveblocks account and a valid secret key.

Installation

Clone the repository:

git clone https://github.com/BaseMax/liveblocks-javascript-authentication.git
cd liveblocks-javascript-authentication

Install the dependencies:

npm install

Start the backend server:

node auth.js

Run npm run dev and open the URL in the browser to see the frontend in action.

Usage

Click the "Connect to Room" button in the frontend to initiate a connection to the Liveblocks room.

The backend will handle the authentication process and return the appropriate response to the frontend.

The frontend will update the status of connected users in real-time.

Folder Structure

liveblocks-javascript-authentication/
├── .gitignore
├── auth.js                # Backend authentication logic
├── index.html             # Frontend HTML file
├── package.json           # Node.js dependencies
├── package-lock.json      # Lock file for package dependencies
├── README.md              # Project documentation
└── room.js                # Liveblocks client configuration

API Endpoints

POST /api/liveblocks-auth

Authenticates the user and authorizes access to a Liveblocks room.

Request Body:

{
  "roomId": "string"
}

Response:

{
  "token": "long string"
}
  • 200 OK: User is successfully authenticated.
  • 400: Authentication failed due to missing or invalid data.

License

This project is licensed under the GPL-3.0 License.

Contributing

Contributions are welcome! Please open an issue or submit a pull request to improve this project.

Copyright 2024, Max Base

About

A simple implementation of user authentication for Liveblocks using JavaScript. Liveblocks is a platform that enables real-time collaborative experiences in web applications. This example demonstrates how to authenticate users and manage access to rooms.

liveblocks.io

Topics

collaborativecollaborative-developmentcollaborative-editingcollaborative-editorcollaborative-frameworkcollaborative-learningcollaborative-researchcollaborative-writingjavascriptjsliveblockliveblocks

Resources

Readme
GPL-3.0 license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.