Node TypeScript ShareX API
This is a Node.js API for ShareX. This is ideal if you want to use ShareX with your own server and domain.
- Full ShareX feature support
- Thumbnail support
- Deletion URL support
- Syntax highlighting
- Discord Logging (optional)
- You can use npm but the readme will use Yarn.
- MySQL Database
- You can place the folder there manually.
- If you want to run in background.
Clone the repository.
git clone https://github.com/busheezy/node-ts-sharex-api
Navigate inside of the directory.
Install the dependencies.
Build the project
Run the database migration.
Edit the config file. You can rename .env.example to .env and edit the values.
You should proxy this with nginx or apache. There is a config here.
Edit API Config
# MySQL database auth information. DB_NAME=sharex DB_HOST=localhost DB_USERNAME=sharex DB_PASSWORD= # This is the API Key we validate ShareX calls with. API_KEY=hunter1 # The Discord webhook URL is for discord loggging via the ShareX "share" feature. # It is optional. DISCORD_WEBHOOK_URL= # We autogenerate thumbnails. Choose how many pixels wide or tall it can be. THUMBNAIL_SIZE=64 # Enable automatic SXCU (ShareX config) file generation # Outputs to /sxcu_generated SXCU=true # The url used to talk to the API. UPLOAD_URL=http://localhost:3000 # The url used for sharing. # Enter the same as UPLOAD_URL for a standard configuration. RETURN_URL=http://localhost:3000
Import ShareX configs
The ShareX configurations are here. You need to import these into ShareX.
Edit the request and response tab for every configuration to reflect your domain.
pm2 start --env production
NODE_ENV=proudction node dist/index.js
Use ShareX like normal.
- Upload text
- Append forward slash and language
The languages are listed here.
Delete via API
Snag your delete url from ShareX. Navigate to the url. The page will give you a code. Append a trailing slash and the code it gives you to complete deletion.
- Load page
- Get code (the response)
- Load page with code appended.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
- Docker support