Use ReplitDB without Replit

Hello everyone, I would like to know if there is any way I can use ReplitDB (JavaScript) without Replit itself (ex. on your own computer).

I know that you have to work with REPLIT_DB_URL but how specifically? Can I get proper instructions on how to?

I am assuming you have to put a REPLIT_DB_URL in Client() but I don’t know if that is the solution. Also, is there any way I can get a DB URL without the creation of a random repl?

2 Likes

Create a .env file and put the following in it:

REPLIT_DB_URL="your-database-proxy-server.doxr.repl.co"

No, what I said above, nothing in Client().

Unfortunately no. Use this template to create your database proxy (it would be advisable for Always On on your proxy as well):

replit.com/@util/Replit-Database-proxy?v=1

3 Likes

Trying now, but I think the database URL changes once in a while?

UptimeRobot?

Oh and I forgot, you have to run

pip install replit

in your command-line prompt.

No, it doesn’t, not if you create a proxy server.

If it works. I’ve heard reports of UptimeRobot not working on Repls.

1 Like

Oh, no, I’m using JavaScript. I’ll assume that I can just use npm.

Works for me :person_shrugging:

Yes,

npm install replit

Great :slight_smile:

2 Likes

No wait sorry!

It has to be

npm install @replit/database

Sorry for the confusion :smiley:

2 Likes

Cool!

Also hopefully mods won’t get angry for this but what if I used something like SQLite, is it hard to switch to?

2 Likes

What do you mean by “switch to”?

2 Likes

ex. change from

client.set("muted-users", muted);

to whatever sqlite uses without having to change the code (ex. sqlite is “client”)

1 Like

I don’t understand what you mean, but I don’t think it will be easy to switch as SQLite and ReplDB are two completely different things.

1 Like


Guess I’ll have to stick to ReplitDB

I’m trying your solution, but Glitch is being a pain rn.

If I helped, please mark my post as solution! :cat2: :smiley:

Cool, I’ll just mark you and try it later.

Both work actually, although if you use env variables you need to make sure you configure env.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.