Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stuyk/altv-ares
An Easy to Use Discord Authentication Client for alt:V
https://github.com/stuyk/altv-ares
Last synced: about 22 hours ago
JSON representation
An Easy to Use Discord Authentication Client for alt:V
- Host: GitHub
- URL: https://github.com/stuyk/altv-ares
- Owner: Stuyk
- Created: 2020-12-24T01:44:13.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-21T14:29:24.000Z (about 3 years ago)
- Last Synced: 2024-05-01T16:36:17.294Z (8 months ago)
- Language: JavaScript
- Size: 34.2 KB
- Stars: 8
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
![](https://thumbs.gfycat.com/OrangePoliticalChicken-size_restricted.gif)
# alt:V Ares - 2.0.0
[❤️ Become a Sponsor of my Open Source Work](https://github.com/sponsors/Stuyk/)
[⌨️ Learn how to script for alt:V](https://altv.stuyk.com/)
[💡 Need a Roleplay Script? Try Athena!](https://gtavathena.com/)
⭐ This repository if you found it useful!
---
# Description
This repository simplifies the entire process of Discord Authentication for alt:V or any GTA:V Framework if you write your own module.
It requires no extra configuration and simply works out of the box. Plug it into your server and users will be able to Authenticate through Discord immediately.
This is the easiest Discord oAuth2 Service. Period.
# Quick Install
```sh
# Install alt:V Installer
npm install -g altv-pkg
``````sh
# Install with alt:V Installer
altv-pkg i stuyk/altv-ares
```# Installing Dependencies / Installation
**I cannot stress this enough. Ensure you have NodeJS 13+ or you will have problems.**
- [NodeJS 13+](https://nodejs.org/en/download/current/)
- An Existing or New Gamemode
- General Scripting KnowledgeClone this repository into your `resources` folder or use the quick install instructions.
Add this resource to your `server.cfg`.
## Install these Dependencies
```sh
npm install elliptic sjcl axios dotenv
```# Setting Up Your Resource for Usage
When the player connect to your server a event will automatically be emitted to open the WebView.
You will recieve the player through `Discord:Opened` when they have opened the view.
```js
alt.on(`Discord:Opened`, (player) => {
// Do something with the Player if you want.
// Setting a player position is recommended here.
});
```You will recieve a player login through this event on server-side with their corresponding discord info.
This is their Authentication data. This is what you use to store data in the database and lookup info from your database.
```js
alt.on('Discord:Login', (player, discordInfo) => {
// discordInfo contains -> // id, username, avatar, discriminator, public_flags, flags, locale, mfa_enabled
console.log(discordInfo.id); // This is their unique discord id.
});
```The player's WebView will **automatically be closed** when the discord login is successful.
The **Discord:Login** event is your **success** event.
# Changelog
```diff
January 20, 2020
+ Portless is supported and enforced now.
+ Completely removed express server.
+ Skip IP Lookup for Portless (Fastest)January 12, 2020
+ Added New Portless Discord Authentication
+ Added New Portless Parameters
+ Added 'dotenv' as a dependencyJanuary 3, 2020
+ Updated Ares Endpoint (Deprecated Old Server Provider)
+ Moved to auto-updating URL under https://ares.stuyk.com/
```