DEV Community

Cover image for I Built a VS Code Extension to Upload Code Snippets to PasteDB in One Click 🚀

I Built a VS Code Extension to Upload Code Snippets to PasteDB in One Click 🚀

Aditya Sorathiya on July 17, 2026

I created the official PasteDB VS Code extension that lets you upload your current file or selected code directly from Visual Studio Code. It inclu...
Collapse
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

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

 
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

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

One ux update
When title or content exceed the limit of characters
Then after showing alert you are emptying that fields
So user has to type that again
So don't delete the content in title and content

 
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

 
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.

 
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

 
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

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...

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

I saw your paste on PasteDB explore
Nice!!
What happened, you were saying that I will integrate PasteDB, is that completed?
I made PasteDB CLI for those people who can't access netlify sites

 
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

 
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

 
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 •

Send me screenshots and explain me in detail what you did

 
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

 
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

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya • • Edited

See can you noticed that in this graph of Google Analytics 4

One thing I don't know
Are these users viewing pastedb
Or also using them by creating pastes

If creating pastes then I m not able to see in my db
If it will be encrypted then I can know that a guest user made (or used) pastedb

Or the final case
I go to school from 8am to 1pm
Then the user's might use pastedb and set expiration of paste or use burn after read so the pastes are deleted till I see the db

Thread Thread
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya • • Edited

From this data
I came to know that users might use pastedb
See the paste_created event
And I have filtered the data because I don't want event made by my device

See the tempUse event also
Both paste_created and tempUse are same
That could also mean that users made paste by using ready made templates

 
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?

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.

 
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...

 
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

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

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

 
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

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

Waiting for the url...

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

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

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

I did got the website
The glitch not fixed

 
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

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

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

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

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

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

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

What can I do?

 
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

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

Store that key in localstorage or on your server

 
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

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

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

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

I have started
I messaged about that first also

 
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

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

That's the great approach
Now I m feeling that one is there who talk with me freely

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

I m dropping users
Trying my best to stable it

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

I would not track user pastes
SECURITY MATTERS!!

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

I m already using Google Analytics events
I have
paste_created -- 75

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

In footer

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

Are you troubling with transfering the code from one device to other?
I found the solution!

 
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

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!

 
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.

 
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?

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

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
 
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!

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya • • Edited

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

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

For static websites I use netlify
For backend I use render

 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

So where do you will store that 256 bit key?

 
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

 
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?

 
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

Collapse
 
aditya_sorathiya_069252f4 profile image
Aditya Sorathiya •

The first user for me for extension????

Some ONE installed my extension!!!!!

 
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

 
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

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!