DEV Community

Cover image for I Built a VS Code Extension to Upload Code Snippets to PasteDB in One Click šŸš€
Aditya Sorathiya
Aditya Sorathiya

Posted on

I Built a VS Code Extension to Upload Code Snippets to PasteDB in One Click šŸš€

I created the official PasteDB VS Code extension that lets you upload your current file or selected code directly from Visual Studio Code. It includes secure API key storage, customizable upload settings, recent paste history, automatic language detection, and instant shareable links. In this post, I'll explain how it works, how to install it, and the challenges I faced while building it.
More Info
View on Marketplace

Top comments (146)

Collapse
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Do any one tried the extension?
Is there something missing?

Collapse
 
codemaster_121482 profile image
Seif Ahmed

I will try it. But can you explain how it works? What is PasteDB, exactly? How does it benefit me?

Thanks in advance!

Collapse
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

PasteDB is a modern paste-sharing platform for developers, students, and anyone who needs to quickly share text, code snippets, logs, notes, or even images using a simple link.
Instead of sending code in chat apps or emails, you can create a paste and share a URL instantly. It supports syntax highlighting, Markdown, custom URLs, password protection, expiration, burn-after-read, end-to-end encrypted pastes, QR sharing, nearby device transfer, analytics, and even a VS Code extension so you can upload code without leaving your editor.
You don't even need an account to create a public paste, but signing in lets you manage your pastes from a dashboard.

Collapse
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya • Edited

If you want end to end encrypted pastes use the web interface at
pastedb.netlify.app/create

As the e2ee is added to web interface only for now

E2ee pastes can be made by selecting Unlisted Or Private as visibility
For e2ee docs go to
pastedb.netlify.app/e2ee

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Thanks for the breakdown! Just a heads-up: Netlify is actually blocked here in Egypt, so I can't access those web links directly without a VPN. The VS Code extension workflow sounds super clean, though—I'll check out the extension side of it!

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I m coming with a solution right a way

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya • Edited

Try this url
sorathiya903.github.io/pastedb/
Note : Navigation is supported through the home page only , so use the Home page menu to go to create page , dashboard etc

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

I saw the website 😯. It's amazing! I think PasteDB is a great tool. It allows developers to share text quickly. Good job šŸ‘, you really did well.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya • Edited

Thank you so much! I'm really glad you were able to try it. Your earlier comment about Netlify being blocked actually motivated me to set up the GitHub Pages mirror so more people can access PasteDB. I'm still improving it, so if you have any suggestions or features you'd like to see, I'd love to hear them.

Thanks, Seif! 😊 I'm glad you could access it through GitHub Pages. Out of curiosity, what kind of projects do you usually work on?

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I m connecting backend from that new site
It may take max 5 min

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Note: If you encounter a 404 Not Found page, make sure the URL contains /pastedb/ after the domain. If it doesn't, simply append /pastedb/ to the URL and reload the page.

Example:
āŒ sorathiya903.github.io/explore
āœ… sorathiya903.github.io/pastedb/exp...

Thread Thread
 
codemaster_121482 profile image
Comment deleted
Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Your app is good and at high level , as making a social media app with securityis not easy, I appreciate that,
I hope this app grows

My recommendations
Start the SEO
Use Google analytics to track user what like or not
Maintain genuine content on Vlox, the social media app

But while making post on Vlox I faced this error

Error creating post: Cannot read properties of undefined (reading 'success')

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I have started your repo

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Thanks! I'll get that issue fixed right away. Since the architecture wasn't originally designed for serverless hosting, so did you notice any slowdowns while using it? I couldn't find a free traditional hosting provider for Express.js, which is why I used for Vercel. Let me know if you have any alternatives for Vercel, and know if you experienced any performance issues!

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

The core issue is because my server isn't designed for serverless hosting, that's why Vercel failed, though I just gave it a try today. If you know any hosting services that supports traditional node.js hosting for free, please let me know!

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

For static websites I use netlify
For backend I use render

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Thanks! šŸ™

I will host it on render then share the link with you!

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

I found that render requires a credit card for verification to prevent fraud, right? It keeps asking me while I don't want to enter my credit card number. Do you have any other hosting that's truly free?

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya • Edited

I have hosted pastedb backend for free
IT has a free plan also

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

When I choose the free plan, click Deploy Web Service, I get this:

Why?

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I don't know
I m able to deploy for free

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

You said enter card first for verification
Are you using normal email password sign-up
Try using Google Login

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

OK, thanks, I will try

Thread Thread
 
codemaster_121482 profile image
Comment deleted
Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

How do you create my account

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Why you didn't talk to me for 4-5 days??

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I gaced this err

Sorry, you have been blocked
You are unable to access bonto.run
Why have I been blocked?
This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?
You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

Cloudflare Ray ID: a20bc6f42ab42739
Your IP: Click to reveal
Performance & security by Cloudflare

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Sorry I didn't clearly read
I thought u created my account

I will create my account
But the err I faced

Sorry, you have been blocked
You are unable to access bonto.run
Why have I been blocked?
This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

What can I do to resolve this?
You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.

Cloudflare Ray ID: a20bc6f42ab42739
Your IP: Click to reveal
Performance & security by Cloudflare

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

Oh wow, I'm so sorry! I wasn't ignoring you at all—I and my family were completely busy moving into a new house these past 4-5 days! I've been unpacking everything. I see what happened with the link now. You got locked out by the hosting site's automated security filter, which sometimes blocks IP addresses by mistake. The app is working perfectly on my end! To bypass that security screen, try turning off your Wi-Fi and opening the link using your phone's mobile data instead, or turn off any active VPN you have running

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Maybe try incognito/private mode.

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Did you successfully create your account? I'm waiting for the first post from you.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I tried with incognito also but I got same, (I was prevented from screenshoting)
There was also no VPN active

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

That's strange šŸ¤”, maybe try 1.1.1.1 VPN by Cloudflare?

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I tried cloudflare 1.1.1.1 and others also
Still not working
Where have you hosted Vlox

Is the backend and frontend hosted in one place?

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Yes, both frontend and backend are hosted on bonto

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

If you host frontend on vercel and backend on other platform
Then it's good
As if in your current system if something happens Backend or if Backend becomes down then frontend will be down or will suffer
But if both are separate then frontend will be live all time
User don't see the crashed Backend server
And frontend talks with Backend through https requests or websocket
And Backend is connected to DB

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I recommend to use Render for backend deployment

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

I know, but Render requires a credit card verification.

Let's try to fix the issue. If you are using an Apple device, go to your Apple device settings and disable iCloud Private Relay. Also, make sure to: Turn off all VPNs (including Proton or 1.1.1.1). Clear your browser cookies/cache or try opening the site using a completely different browser app (like Firefox instead of Chrome). If this still fails, I'll host it temporary elsewhere so you can try it.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Try render with google registration,
How you are signing in on render

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

I created the account using Google and encountered the same issue.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Send me screenshots and explain me in detail what you did

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

OK, here is what I did exactly:

  1. I open render.com
  2. I click Google
  3. I am logged in. Now I click deploy a web service
  4. I choose the repo from GitHub
  5. I enter all the data and choose the free plan
  6. I click deploy but it shows this:

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Now what?

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya • Edited

It seems you are choosing the paid plan
Choose the free plan before deploying

Click the free plan so it gets selected

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Or use railway instead for deploying your project

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Comment deleted
Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Thanks Aditya!

I'll try creating a new account on render, if it works, I'll share the link with you.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

While creating new account , use other network or phone data, and try this also
Keep the phone for flight mode for 15s
That will reset your ip
Then make a new account

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Thanks, I will try 😃.

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

I did the exact same steps again. I kept my phone in flight mode for 15s and recreated a new account but got the same error. That's what Gemini said

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Maybe I'll try to host in railway. Many thanks for your help 😊

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Waiting for the url...

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Railway only offers a temporary free tier.
So, I will try host it on PandaStack.

Just give me a few moments.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Yes PandaStack is good with free tier
AND ITS REDIS
Waiting for url...

Thread Thread
 
codemaster_121482 profile image
Comment deleted
Thread Thread
 
codemaster_121482 profile image
Comment deleted
Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I did got the website
The glitch not fixed

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Comment deleted
Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Maybe try these two quick advanced fixes so you can get in:

  • Change Private DNS: Go to your phone's network settings, find Private DNS, and set it to manual with dns.google or 1.1.1.1.

  • Switch VPN: If you are using a VPN, change its connection protocol in the app settings to WireGuard or OpenVPN, then connect to a US or UK server.

You'll need to find and download a free .conf or .ovpn server file online (like from VPN Gate) to load into WireGuard or OpenVPN.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I tried all thing
With VPN and without VPN
Nothing worked
The opendns and 1.1.1.1 is also not working for that

Thread Thread
 
codemaster_121482 profile image
Comment deleted
Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I went to browserling.com/

Entered vlox.bonto.run
And boom the site opened!!

in phone

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

After that created a account and then a post that you asked

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

And how was the surprise?

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

This is the best surprise ever 🄹

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

What do you want to talk about in Vlox? 😁

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Start the seo then
Are you getting users?
Request indexing on Google search console

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Thanks 😊, I will request indexing on Google search console.

Can you help me and share it with your friends? 🄺

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

My friend don't use pastedb (my app)
They how I can convince to use Vlox??

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

I totally get that, it's frustrating when friends don't jump on your app first! But honestly, Vlox is a social media app—you could use it as a megaphone to promote PasteDB. Even better, what if we officially integrate PasteDB into Vlox down the road? You would get full credit and become a contributor, and it could bring a ton of eyes to your platform. Let’s help each other grow!

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Hoe can I promote pastedb then
I think for a idea which is useful for both Vlox and pastedb

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya • Edited

Chatgpt response was
If Vlox is a social media platform, there are several ways PasteDB could integrate that also benefit Vlox instead of feeling like an advertisement.

Some ideas:

  1. Code Snippets (Best option)

When a user creates a post containing code:

They click "Create Paste"

Vlox uploads the code to PasteDB

The post displays a preview like:

šŸ“„ Python Snippet
pastedb.netlify.app/paste/abc123

View Full Code →

This keeps long code out of the social feed.


  1. Large Text Sharing

Instead of posting thousands of characters:

Read the full article ↗
Powered by PasteDB


  1. Bug Reports

Developers can attach:

logs

stack traces

configuration files

using PasteDB links.


  1. Collaboration Links

Someone shares:

Join Collaborative Editor

Friends open the PasteDB collaboration page directly.


  1. Developer Profile

If Vlox has developer accounts:

Projects

PasteDB
GitHub
Portfolio


  1. API Integration

Expose an API like:

POST /api/create

Vlox creates pastes automatically and stores only the returned URL.


  1. Embedded Preview

Instead of only a link:

──────────────
PasteDB Preview

Language: Python

print("Hello")

View More →
──────────────


What's in it for both?

PasteDB gets:

New users.

More API usage.

Brand visibility.

Vlox gets:

Clean posts.

No need to build its own code-sharing service.

Better experience for developer users.

The key is to make PasteDB feel like a feature inside Vlox rather than an external promotion. That way, both projects gain value from the integration.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Don't might the numbering

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

You can also add iframe containing src of pastedb paste viewer for any paste

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

These are brilliant ideas! šŸ’”

Let's implement the first option.
The plan:

  1. First, a user creates a code block.
  2. Next, they click "Create Paste".
  3. Then, it then sends the data (Via a POST request) from Vlox server to PasteDB server.
  4. After that, PasteDB creates the save (Which database are you using? SQL or MongoDB or something else?).
  5. Finally, send a success message with the paste link.

Do you want to tweak any part of the plan?

Thread Thread
 
codemaster_121482 profile image
Comment deleted
Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Great plan! One small suggestion: I already have an SDK for PasteDB, so instead of manually making POST requests, Vlox can simply use the SDK. It handles the API calls and returns the paste URL. Internally, PasteDB uses a FastAPI backend with MongoDB. Using the SDK will make the integration cleaner and make future updates easier without changing your code.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

MongoDB Atlas

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

That’s great! 😃

Should we embed the SDK function directly into Vlox, or have Vlox send a POST request to PasteDB to handle it?

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

But the SDK is in python
And your backend is in node js

What can I do?

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

We don't need to rewrite anything or mix Python into Node! Vlox can just send an HTTP POST request to your PasteDB backend API with the text payload. PasteDB saves it, creates the paste, and responds back to Vlox with the URL or ID. That way, Vlox stays Node.js, PasteDB stays Python, and they just talk through HTTP!

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I made a node js SDK for PasteDB
See the docs at pastedb.netlify.app/jsdocs
And for npm at
npmjs.com/package/pastedb-js

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

Great!
Now, is there a mirror page for the docs? Because netlify is blocked in Egypt.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

You said of post requests
But what about ownership
The paste will belong to whom?
Will it be guest?
If guest paste then no one can edit it
Or you can do this
Say the user to make the API key of pastedb of user by registering them to pastedb
And put that api key in vlox to make pastes whose owner is user

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

I'll try browserling or ProtonVPN.

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Great catch!

Here’s the best way to do it without annoying the user: When someone creates a Vlox account, Vlox's backend will automatically call PasteDB's API during signup to generate a PasteDB account/API key for them behind the scenes. Vlox saves that API key in the user's MongoDB profile. Whenever that user creates or edits a paste on Vlox, we pass their personal PasteDB key. Seamless for the user, proper ownership for PasteDB

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

I read the docs via onlinevpn.app! I'll implement it now. Quick question for you: Should we use the Automated SSO Bridge method—where Vlox silently generates/fetches a dedicated PasteDB API key for each user on signup and stores it securely in MongoDB to handle all their pastes or do you prefer a different approach?

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Would we make the user enter the API key on every paste or one time enter during login?

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Store that key in localstorage or on your server

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Perfect!

Now, does the SDK include a way to get the API key? Because doing client.me() returns only the email and ID based on the doc.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

You can't do that
It will exploit sensitive information of user
If I allow you to make api at the name of the user without asking them then that would be trouble for both of us
Instead say if you want to make a stylish paste , enter the API
Or something like that

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

How will you make account
By normal email and password
Or let the user register
I only have Continue with Google way to be registered or loggedin
So you can't make a account as things like email of user can not be used without their permission
Etc

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

But why we need to get the API key
User will enter the API key if he want
And Vlox can save in localStorage or indexed db (in the device) or can be stored on Vlox Database or server

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

That makes total sense regarding Google OAuth! Here’s the final plan on my side:

Integration Plan

  1. A user creates a post.
  2. They click "Create Paste".
  3. The system creates the actual paste via the API using one of two paths:
    • šŸ”‘ If provided: Vlox attaches their API key so the paste lands directly in their personal PasteDB account with full ownership.
    • šŸ‘» If left blank: Vlox automatically posts it as a Guest Paste.
  4. Return the link.

Does this plan sound good to you to get started with integration?

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Does PasteDB SDK support from another account?

const client = new Client("ENTERED_API");
Enter fullscreen mode Exit fullscreen mode

Or the user would need to configure their PasteDB account credentials one time before? Because you said there is no email/password, it's only Login with Google.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I don't understand this
Explain me
There is no account in SDK
Just the API key

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Yes, that sounds good to me.

Integration flow:

  • If the user provides a PasteDB API key, Vlox sends it with the request, and the paste is created under that user's PasteDB account.
  • If no API key is provided, the paste is created as a Guest Paste.
  • PasteDB returns the paste URL/ID, and Vlox displays it to the user.

This keeps the integration simple while giving users full ownership of their pastes when they choose to connect their PasteDB account.

But give a warning that these paste will not be edited or managed in future is no api key
To edit , add the PasteDB API KEY

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Yes. The SDK works with any valid PasteDB API key.


const client = new Client("USER_API_KEY");

If the API key belongs to User A, all operations are performed on User A's PasteDB account. If it belongs to User B, they happen on User B's account.
Users don't need to enter their Google account credentials into Vlox. They only need to log in to PasteDB once, generate an API key from their PasteDB dashboard, and paste that key into Vlox. After that, Vlox can securely store the API key (locally or on your server) and use it for future requests.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

The integration plan looks good to me. I do have one suggestion about the UI though.

Right now, everything seems to be on a single page. I think the design would benefit from an upgrade by splitting content into dedicated pages.

For example:

  • Home / Feed
  • Login / Sign Up
  • About
  • Contact
  • Terms of Service
  • Source Code (GitHub)
  • How Vlox Works
  • Privacy Policy

Keeping only the post feed on the main page and moving the informational content to separate pages will make the app feel cleaner, more professional, and much easier to navigate.

 
codemaster_121482 profile image
Seif Ahmed • Edited

Sure!

Give me one day or two days and I'll implement everything securely, and I'll hash the the API keys too, using cryptr and AES-256

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya • Edited

But one problem
Hashing is one way
IT can't be reversed to a raw api

One small note though: if Vlox needs to use the API key later, don't hash it.
If you store it on your server, encrypt it (AES-256 is a good choice) and decrypt it only when making a request to PasteDB. If you store it only on the user's device, that's fine too.

Storing in IndexedDB is good for now
If user wants to update api he can do , no fetchs to api and change on server
It's fast also
As if first getting the api key from db then making paste is time consuming

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

But one problem
Hashing is one way
IT can't be reversed to a raw api

One small note though: if Vlox needs to use the API key later, don't hash it.
If you store it on your server, encrypt it (AES-256 is a good choice) and decrypt it only when making a request to PasteDB. If you store it only on the user's device, that's fine too.

Storing in IndexedDB is good for now
If user wants to update api he can do , no fetchs to api and change on server
It's fast also
As if first getting the api key from db then making paste is time consuming

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

I know, but AES-256 encryption can be reversed. AES-256 is mathematically reversible with the correct 256-bit key, but it cannot be cracked, reversed, or decrypted without that key.

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

And that key is controllable by Vlox, not the user.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

So where do you will store that 256 bit key?

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

It's stored in the environment variables, like that .env file.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

It means one key that encrypts the api key of users and that key will be with you?

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Yeah. It means it will be with the admins, meaning me and you.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

If u store that one key in env then yes, that's secure against someone stealing the database, but it's not end-to-end encryption. Since Vlox has both the encrypted API key and the AES key from the environment, Vlox can decrypt and read the API key whenever needed. It's server-side encryption (encryption at rest), which is perfectly valid, just not E2EE.

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Spot on—it's standard server-side encryption at rest to protect the DB while letting the backend handle the API integration seamlessly. Glad we're on the same page! Heading to the code now to ship this.

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Perfect! šŸ‘ That's exactly what I wanted to clarify. Server-side encryption at rest is a good approach for this use case. Looking forward to seeing the integration.

So if you want you can start integration
If any error occurs in node js SDK, u are free to tell me

 
codemaster_121482 profile image
Seif Ahmed

How can I get my own PasteDB API key?

 
codemaster_121482 profile image
Seif Ahmed

Great idea.

So, we make an optional input field if the user wants to enter their API key, right?

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Yo! Was setting up the integration UI today and realized if we just run PasteDB in the background, users won't even see your platform.

So instead of hiding it in the backend, I’m adding a direct [ šŸš€ Open in PasteDB ] button straight on the Vlox editor. It’ll grab their snippet and launch it on PasteDB in a new tab.

Keeps Vlox fast, gives PasteDB direct traffic/spotlight, and avoids cross-server lag headaches for both of us. Sounds good?

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

The code is so simple:

NS(NS.createEl("i", postHeaderIconsGroup, { className: "fas fa-paste post-header-group-icon" })).on("click", function () {
    NS.copy({
        text: post.content,
        onSuccess: () => {
            Swal.fire({
                title: "Success",
                text: "Copied! Click OK to open PasteDB!",
                icon: "success",
                showCancelButton: true,
                confirmButtonText: "OK",
                cancelButtonText: "Cancel"
            }).then(result => {
                if (result.isConfirmed) window.open("https://pastedb.netlify.app/", "_blank");
            });
        },
        onFailure: () => {
            Swal.fire("Error", "Failed to copy. Try again later", "error");
        }
    });
});
Enter fullscreen mode Exit fullscreen mode

Do you want to change to link to the exact creation page? Did you like the font awesome paste icon or do you want to change it to text? Just tell me all your wishes!

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

This way, it's 100% bullet proof, secure against attacks, and keeps both our server codes as is!

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Now, you can easily see the try the changes here: vlox.containers.snapdeploy.app/

(Guess what? The exact Github commit message was "Intergated PasteDB created by my friend Aditya" šŸ˜‰)

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Where would you like to add "Powered By PasteDB"?

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

But if that icon opens pastedb then what is the meaning of that icon
If user has made a paste by pastedb and he adds a link that show this paste then you can add
View full post on pastedb

For now temporarily its ok
Would you like that I upgrade the ui?

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I upgraded the ui
You can see at
sorathiya903.github.io/pastedb/pas...

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

I checked out the mock-up—I appreciate you taking the time to design that layout! ⚔"

For Vlox, I’m sticking with the current bright layout and blue palette. That light, clean look is the core brand identity I built Vlox around, so I want to keep it uniform for all users.

And sure, will add "Powered By PasteDB" in footer.

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I recommend one thing
Use uptimerobot so that your server not sleeps
UpTimeRobot will send a request to any of your pages so that server is kept alive

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Great idea.
I will definitely consider it. šŸ‘

One follow-up question: Where would you like to place "Powered by PasteDB"?

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

In footer

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Yes it's good
You can show powered by pastedb

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Yes you can if you want

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I got a bug
When I click copy btn (the link icon)
This thing is copied
localhost:3000/?id=6a704b4e2d33a12...

I recommend to upgrade the ui also

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Great catch šŸ˜….

I'll fix the bug now.

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Checked out the mock-up—I appreciate you taking the time to design that layout! ⚔"

For Vlox, I’m sticking strictly with the current bright layout and blue palette. That light, clean look is the core brand identity I built Vlox around, so I want to keep it uniform for all users.

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

I fixed the copy link bug too, try it now.

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

It was a pleasure to work with you!

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed • Edited

Can you star the repo on Github?

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

I have started
I messaged about that first also

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Ah, my bad! Totally missed that earlier. Thanks a lot for the star, really appreciate it!

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

I really admire how good you are at marketing and reaching developers—how do you manage to do that so effectively?

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

You can get your answer at dev.to/aditya_sorathiya_069252f4/h...

Or in cracked English at pastedb.netlify.app/about

Thread Thread
 
codemaster_121482 profile image
Seif Ahmed

Thanks, my friend.
It was a pleasure to work with you.
Wishing you all the best. šŸŽ‰

Collapse
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

The extension is a companion to PasteDB that lets you upload code snippets directly from VS Code without opening your browser. Simply select the code you want to share, right-click, choose Upload to PasteDB, and it uploads the snippet and copies the shareable link to your clipboard.
Setup is simple:

  1. Install the PasteDB extension from the VS Code Marketplace.

  2. Generate an API key from your PasteDB dashboard and save it in the extension. With an API key, your pastes are linked to your account and can be managed later.

3.Select some code, right-click, and choose Upload to PasteDB (or use the Command Palette).

The goal is to make sharing code as quick as possible without interrupting your workflow. If you give it a try, I'd really appreciate any feedback or suggestions!

Collapse
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Thanks! 😊
The VS Code extension is a companion to PasteDB. It lets you upload code snippets directly from VS Code without opening your browser.
Just select the code you want to share, run the PasteDB command (or use the context menu), and the extension uploads it to PasteDB, automatically copying the shareable link to your clipboard.
It's useful when you want to quickly share code with teammates, ask for help on forums, submit snippets in chats, or save code for later—all without leaving your editor.
If you use an API key, the pastes are saved to your PasteDB account so you can manage them later. You can also create guest pastes if you don't want to sign in.
I'd love to hear your feedback if you give it a try!

Collapse
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Tip: If pastedb.netlify.app is blocked in your country, try using a VPN for the best experience. Alternatively, you can access the GitHub Pages mirror at sorathiya903.github.io/pastedb/⁠

Note: If you encounter a 404 Not Found page, make sure the URL contains /pastedb/ after the domain. If it doesn't, simply append /pastedb/ to the URL and reload the page.

Example:
āŒ sorathiya903.github.io/explore
āœ… sorathiya903.github.io/pastedb/exp...

Collapse
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Can any one make a paste as a registered user
I want my 1st registered user

Collapse
 
codemaster_121482 profile image
Seif Ahmed

Super good job šŸ‘šŸ‘

Collapse
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

The first user for me for extension????

Some ONE installed my extension!!!!!

Collapse
 
shiwei_xie_24a93f54203fb3 profile image
shiwei xie

Nice write-up! For devs who deal with messy copied text, TextStow might help — it's a Mac menu bar tool combining clipboard history with prompt templates and text cleanup. Free: textstow.com

Collapse
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya

Thanks! I appreciate it. 😊 TextStow looks interesting for clipboard management and text cleanup. PasteDB is focused on making it quick to upload and share code snippets (and other content) through shareable links, especially directly from VS Code. Thanks for sharing!

Some comments may only be visible to logged-in visitors. Sign in to view all comments.