{"id":25171520,"url":"https://github.com/basemax/liveblocks-javascript-authentication","last_synced_at":"2025-04-03T21:21:57.552Z","repository":{"id":264876701,"uuid":"862414701","full_name":"BaseMax/liveblocks-javascript-authentication","owner":"BaseMax","description":"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.","archived":false,"fork":false,"pushed_at":"2025-01-23T09:30:13.000Z","size":118,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T17:08:07.626Z","etag":null,"topics":["collaborative","collaborative-development","collaborative-editing","collaborative-editor","collaborative-framework","collaborative-learning","collaborative-research","collaborative-writing","javascript","js","liveblock","liveblocks"],"latest_commit_sha":null,"homepage":"https://liveblocks.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-24T15:00:30.000Z","updated_at":"2025-01-23T09:30:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f45bab3-9869-4ed0-ba0d-464103f7d026","html_url":"https://github.com/BaseMax/liveblocks-javascript-authentication","commit_stats":null,"previous_names":["basemax/liveblocks-javascript-authentication"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fliveblocks-javascript-authentication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fliveblocks-javascript-authentication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fliveblocks-javascript-authentication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fliveblocks-javascript-authentication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/liveblocks-javascript-authentication/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247079309,"owners_count":20880030,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collaborative","collaborative-development","collaborative-editing","collaborative-editor","collaborative-framework","collaborative-learning","collaborative-research","collaborative-writing","javascript","js","liveblock","liveblocks"],"created_at":"2025-02-09T09:20:47.122Z","updated_at":"2025-04-03T21:21:57.532Z","avatar_url":"https://github.com/BaseMax.png","language":"JavaScript","readme":"# Liveblocks JavaScript Authentication\n\nThis 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.\n\n![Liveblocks JavaScript Authentication](https://github.com/user-attachments/assets/57221258-05c2-44b6-a07b-724c060b7197)\n\nhttps://liveblocks.io\n\n## Features\n\n- Generate unique user IDs for session management.\n- Manage user access to different rooms based on organization and group.\n- Simple integration with Liveblocks for real-time collaboration.\n- Example frontend and backend implementation.\n\n## Prerequisites\n\nBefore you begin, ensure you have met the following requirements:\n\n- [Node.js](https://nodejs.org/) installed on your machine (version 14 or later).\n- A Liveblocks account and a valid secret key.\n\n## Installation\n\nClone the repository:\n\n ```bash\n git clone https://github.com/BaseMax/liveblocks-javascript-authentication.git\n cd liveblocks-javascript-authentication\n ```\n\nInstall the dependencies:\n\n```bash\nnpm install\n```\n\nStart the backend server:\n\n```bash\nnode auth.js\n```\n\nRun `npm run dev` and open the URL in the browser to see the frontend in action.\n\n## Usage\n\nClick the \"Connect to Room\" button in the frontend to initiate a connection to the Liveblocks room.\n\nThe backend will handle the authentication process and return the appropriate response to the frontend.\n\nThe frontend will update the status of connected users in real-time.\n\n## Folder Structure\n\n```\nliveblocks-javascript-authentication/\n├── .gitignore\n├── auth.js                # Backend authentication logic\n├── index.html             # Frontend HTML file\n├── package.json           # Node.js dependencies\n├── package-lock.json      # Lock file for package dependencies\n├── README.md              # Project documentation\n└── room.js                # Liveblocks client configuration\n```\n\n## API Endpoints\n\n### `POST /api/liveblocks-auth`\n\nAuthenticates the user and authorizes access to a Liveblocks room.\n\nRequest Body:\n\n```\n{\n  \"roomId\": \"string\"\n}\n```\n\nResponse:\n```\n{\n  \"token\": \"long string\"\n}\n```\n\n- **200 OK:** User is successfully authenticated.\n- **400:** Authentication failed due to missing or invalid data.\n\n## License\n\nThis project is licensed under the GPL-3.0 License.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request to improve this project.\n\nCopyright 2024, Max Base\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fliveblocks-javascript-authentication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fliveblocks-javascript-authentication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fliveblocks-javascript-authentication/lists"}