Skip to content
← Back to Community
repl chat: Integrated global chat for repl.it
Profile icon
h
has Hacker Plan
MrEconomical

repl chat yey

After making repl mail, I still wasn't satisfied. There was a mailing system now, but no way to chat in real time on repl.it itself. So I decided to make a chat system cool kek.

Features

(yes I love this repl share post format dont judge)

  • Log in with repl auth - use repl auth to log in with your repl account @amasad
  • Integrated - repl chat pops up right on repl.it! I styled it based on the multiplayer chat so it is a little window on the bottom right. I just tweaked a few things to improve the UI where I saw fit. More on this in Usage Instructions
  • Fast - repl chat uses WebSocket to send chat messages in real-time
  • Message history - unlike many other chat applications cough cough and somewhat repl multiplayer chat itself cough cough repl chat stores the last 50 messages so you will have context every time you log on

Usage Instructions

To use repl chat in repl.it, save it as a bookmarklet. A bookmarklet is basically a bookmark that on click executes some javascript code, in this case adding the repl chat window to repl.it.

  1. Create a new bookmark (name it whatever you want)
  2. In the url section, copy and paste this:
javascript:!function(){if(location.href.startsWith("https://repl.it")){const t=document.createElement("script");t.id="repl_chat_script",t.src="https://repl-chat.mreconomical.repl.co/use/bookmark.min.js",document.body.appendChild(t)}else alert("Go to https://repl.it to use repl chat!")}();
  1. Now, when you are on repl.it, if you want to add the repl chat window, simply click on the bookmark!

If you really wanted to, you could use the browser client here: https://repl-chat.mreconomical.repl.co but why tho?

DATABASE SOURCE CODE: https://repl.it/@MrEconomical/repl-chat-database-source

Voters
Profile icon
ADELMUHAMMED
Profile icon
mikoder
Profile icon
TheDestroyer99
Profile icon
AnasQiblawi
Profile icon
Acer123
Profile icon
techgeek680
Profile icon
Roar123
Profile icon
Makrayne
Profile icon
BlueComet
Profile icon
sycrepl
Comments
hotnewtop
Profile icon
JordanDixon1

How do I make a chat for only me and my friends? In other words, how do I make a private chat after I fork the repl?

Profile icon
MrEconomical

@JordanDixon1 you're going to have to set up your own database

Profile icon
JordanDixon1

@MrEconomical How do I do that? Can you walk me through that?

Profile icon
MrEconomical

@JordanDixon1 ok sure, do you have discord or something

Profile icon
JordanDixon1

@MrEconomical No. however I can invite you to the repl I forked.

Profile icon
JordanDixon1

@MrEconomical How would I set up my own database?

Profile icon
MrEconomical

@JordanDixon1 get back on your repl im just going to give you a copy of my database without any data in it

Profile icon
JordanDixon1

@MrEconomical Ok, well now I have everything on there, but it still isn't working. The terminal returns with: Invalid value "undefined" for header "repl-chat-key"

Profile icon
MrEconomical

@JordanDixon1 you need to create a database key, then in the .env in repl chat put REPL_CHAT_KEY = your key here and in the config.json on the database put replChatKey: your key here as a JSON property

Profile icon
JordanDixon1

@MrEconomical could you change it for me and then show me what you changed? I have invited you to the database as well I believe.

Profile icon
AtticusKuhn

very cool

Profile icon
AllAwesome497

An Error occurred: Failed to authenticate :(

Profile icon
MrEconomical

@AllAwesome497 rEpL aUtH

Profile icon
bramley

@AllAwesome497 Repl Auth is weird on mobile devices, and nobody seems to know why. @amasad ?

Profile icon
P3tray

You should probably put out a guide on how to make your own database, i will try to figure it out myself for now. Also, i have tried to modify the simple JavaScript function to allow it to work elsewhere, however it does not seem to work. Is that possible (I am probably doing it wrong, because i rarely use JS)?

This thing is amazing.

Profile icon
MrEconomical

@P3tray it might be possible on some sites, but many sites block script requests to other sites (for instance, google sites) so it wont work on any of those

Profile icon
P3tray

Nevermind. I probably will not be able figure it out because i cannot access any blank sourcecode for the database. I am too lasy unskilled to make my own completely from scratch trying to figure out what the sourcecode would be.
@MrEconomical
You should make https://repl-chat-database-source.mreconomical.repl.co containing the source without any logs or data, because that would really help. Great work.

Profile icon
MrEconomical

@P3tray good idea, go there now

Profile icon
P3tray

@MrEconomical Thanks, working on making a button that will work universally too (still using repl.it auth), i can give you the code as well if i get it done.

It will probably be done tomorrow, as i have no time now.

And yeah, most sites will not like it.

Profile icon
P3tray

Got that chat working for me. Took a while to figure out which errors where coming from where, and which parts i broke trying to fix other parts.

The main problem was figuring out the key, i set it through the console of the repl-chat (process.env.REPL_CHAT_KEY = "your key here".

I also put a comma where i shouldn't... That confused it and didn't give an error, the messages would not load.

Profile icon
P3tray

Personal database working on other sites.

Repl.it chat on DuckDuckGo:

image

Profile icon
Giothecoder

Hm. iPad safari doesn’t like it... much sadness. 😞

Profile icon
bramley

@Giothecoder Repl Auth is weird on mobile devices, and nobody seems to know why. @amasad ?

Profile icon
Giothecoder

@bramley no that’s not it actually, Safari doesn’t allow you to run js in that way with the bookmarks. 😩😞

Profile icon
bramley

@Giothecoder oh rip screw you apple

Profile icon
Giothecoder

@bramley honestly yes, they are so frustrating sometimes.

Profile icon
Nanowrimoijk

Does it cover up the multiplayer chat box when shrunk?

Profile icon
MrEconomical

@Nanowrimoijk no actually, I made it so you can't use both at the same time and it sits right above the multiplayer chat! (screw repl's jsx stuff I had to figure that out for an hour)

Profile icon
Nanowrimoijk

@MrEconomical lol, this is so cool, you did a great job!

Profile icon
TheDestroyer99

@MrEconomical Can I Use This For A DM/Chat Service?
Also, Can You Help Me?

Profile icon
bhavishya2107

great job

Profile icon
HackermonDev

This file cannot be displayed:

Profile icon
EthanWalker3

@MrEconomical
It says failed to authenticate? What should I do?

Profile icon
MrEconomical

@EthanWalker3 repl auth is in beta and very buggy atm

Profile icon
PizzaRules668

How do I make a chat for my friends using google to log in not repl?

Profile icon
julienlebg74

hello

Profile icon
CodingEpic

@TaylorLiang Were you so depressed after that experience that you deleted your account?

Profile icon
YueChen1

hey

Profile icon
ThePuzzlerThree

Do you have a chat moderator? Also if you can fork this and make it private for our thing we have to talk about. Sorry I'm so hard to get a hold of. :P

Profile icon
MrEconomical

@ThePuzzlerThree just get discord bruh moment

Profile icon
ThePuzzlerThree

@ThePuzzlerThree have a good time for us to chat on the....chat about the logo design?

Profile icon
MrEconomical

@ThePuzzlerThree get discord and join the repl discord (in the bottom left) and then we'll take it from there

Profile icon
ThePuzzlerThree

@MrEconomical i dont have a thing to get the app on and i can't get on it becuase my school blocks everything

Profile icon
ThePuzzlerThree

@MrEconomical and my parents won't let me make my own account

Profile icon
ThePuzzlerThree

@MrEconomical i told you, i cant get discord

Profile icon
MrEconomical

@ThePuzzlerThree then just use repl mail

Profile icon
ThePuzzlerThree

@MrEconomical im sorry

Profile icon
ThePuzzlerThree

@MrEconomical did u send

Profile icon
MrEconomical
Profile icon
MrEconomical

@ThePuzzlerThree I think there's a bug in repl mail, it's not sending the message one sec i can fix

Profile icon
ThePuzzlerThree

@MrEconomical I got ur email

Profile icon
P3tray

@MrEconomical If you forget to logout of your previous session (and don't close the window), and try to access the page from another PC, there is no way to login and delete your last session. I have tried to visit /login again, but it will not delete the last session. I left myself logged in at work...

Profile icon
MrEconomical

@P3tray if you log in it automatically deletes your previous session
also click on your pfp in the upper left and press logout

Profile icon
Dart

Dude this is really cool! hope i can make something this awsome at some point

Profile icon
jhman103751

I am a teacher of 5 computer science classes and am wondering if it is possible to make a private version of this that i could use with ll my students? also is there a transcript that is made with this in a console?

Profile icon
MrEconomical

@jhman103751 do you have discord to communicate easier? I would love to help

Profile icon
jhman103751

@MrEconomical I currently do not, but can communicate by email or phone? i can get discord today but it will not be until 6:30 EST

Profile icon
MrEconomical

@jhman103751 discord is preferred for instant messaging I will just wait I am in school now anyways

Profile icon
jhman103751

@MrEconomical ok wonderful, ill comment right around 6:30est

Profile icon
jhman103751

@jhman103751 I just made an account with discord, how do we connect? @MrEconomical

Profile icon
MrEconomical

@jhman103751 whats your discord tag tell me on repl chat

Profile icon
jhman103751
Profile icon
MrEconomical

@jhman103751 what are the 4 numbers

Profile icon
jhman103751
Profile icon
MrEconomical

@jhman103751 accept friend req

Profile icon
jhman103751
Profile icon
ocotton2019

dis chat is sick bro

Profile icon
[deleted]

cool, I mde something like this, but with less css