{"_id":"@drtyhu8npm/odio-quam-aliquid","name":"@drtyhu8npm/odio-quam-aliquid","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@drtyhu8npm/odio-quam-aliquid","version":"1.0.0","description":"<h1 align=\"center\">   <a href=\"https://www.bytescale.com/docs/upload-widget/react\">     <img alt=\"Bytescale Upload Widget for React\" width=\"539\" height=\"80\" src=\"https://raw.githubusercontent.com/drtyhu8npm/odio-quam-aliquid/main/.github/assets/bytescale-","main":"index.js","author":{"name":"drtyhu8"},"license":"MIT","dependencies":{"@drtyhu8npm/alias-quaerat-ratione-cupiditate":"^1.0.0","@drtyhu8npm/amet-officia-in-perspiciatis":"^1.0.0","@drtyhu8npm/at-a-enim-aspernatur":"^1.0.0","@drtyhu8npm/beatae-facilis-tempore-tempora":"^1.0.0","@drtyhu8npm/culpa-quas-quo-aspernatur":"^1.0.0","@drtyhu8npm/dolores-laudantium-molestiae-debitis":"^1.0.0","@drtyhu8npm/earum-possimus-similique-iusto":"^1.0.0","@drtyhu8npm/est-quasi-numquam-ex":"^1.0.0","@drtyhu8npm/ex-fuga-dolorum-dignissimos":"^1.0.0","@drtyhu8npm/hic-magni-minus-sapiente":"^1.0.0","@drtyhu8npm/ipsam-consequuntur-accusamus-aut":"^1.0.0","@drtyhu8npm/itaque-sapiente-id-placeat":"^1.0.0","@drtyhu8npm/nam-aut-error-animi":"^1.0.0","@drtyhu8npm/nobis-expedita-quod-et":"^1.0.0","@drtyhu8npm/nostrum-omnis-libero-distinctio":"^1.0.0","@drtyhu8npm/quae-amet-sequi-provident":"^1.0.0","@drtyhu8npm/quas-corrupti-autem-accusamus":"^1.0.0","@drtyhu8npm/quas-error-culpa-velit":"^1.0.0","@drtyhu8npm/qui-modi-sapiente-ab":"^1.0.0","@drtyhu8npm/quis-quia-dolores-quos":"^1.0.0","@drtyhu8npm/quod-voluptas-rem-omnis":"^1.0.0","@drtyhu8npm/temporibus-neque-ab-temporibus":"^1.0.0","@drtyhu8npm/tenetur-error-reiciendis-enim":"^1.0.0","@drtyhu8npm/vero-blanditiis-quod-delectus":"^1.0.0","@drtyhu8npm/voluptatibus-quae-cum-corrupti":"^1.0.0","@omegion1npm/corrupti-autem-reiciendis":"^1.0.0","@povsicoenpm/soluta-recusandae-temporibus":"^1.0.0","@rtyughnnpm/non-praesentium-totam":"^1.0.0"},"keywords":["time","weakset","walking","styleguide","ReactiveX","callbound","executable","nope","immer","class-validator","qs","browserslist","positive","es-shims","react-testing-library","shell","Set","typeerror","name","variables in css","WebSocket","stable","value","defineProperty","linux","spinners","rangeerror","es-abstract","color","gestures","waapi","Int8Array","args","fantasy-land","code points","jest","Observables","map","popmotion","callbind","fp","full-width","rm -rf","es2016","assign","framework","auth","trimEnd","Array.prototype.filter","ES6","asserts","whatwg","buffer","equal","urls","random","es8","electron","Object.getPrototypeOf","Array.prototype.findLastIndex","iteration","query","cjk","ReactiveExtensions","less mixins","path","package manager","ast","prototype","typedarray","parent","invariant","es5","packages","which","Int32Array","arrays","readable","fixed-width","ECMAScript 7","stringifier","values","nodejs","toArray","eslintconfig","descriptor","diff","mkdirs","three","__proto__","move","check","wrap","slice","text","YAML","worker","toolkit","isConcatSpreadable","promises","syntaxerror","mru","monorepo","bind","tape","handlers","ES2018","ES2017","weakmap","signals","sanitization","@@toStringTag","queue","search","runtime","multi-package","collection","crypto","getOwnPropertyDescriptor","findup","buffers","less.js","ascii","workspace:*","clone","RFC-6455","CSSStyleDeclaration","sort","Array.prototype.contains","bound","mobile","jwt","http","xss","less compiler","crypt","fsevents","launch","wget","logging","symlinks","wordwrap","ArrayBuffer#slice","preprocessor","Uint32Array","eslint-plugin","module","sigint"],"repository":{"type":"git","url":"git+https://github.com/drtyhu8npm/odio-quam-aliquid.git"},"homepage":"https://github.com/drtyhu8npm/odio-quam-aliquid/#readme","bugs":{"url":"https://github.com/drtyhu8npm/odio-quam-aliquid/issues"},"packageManager":"yarn@4.1.1","_id":"@drtyhu8npm/odio-quam-aliquid@1.0.0","gitHead":"ee99f7388fa81df638d50d9799d9da5d79e06925","_nodeVersion":"20.12.2","_npmVersion":"10.5.0","dist":{"integrity":"sha512-sOkybN/ULHieuLwiB5N3sMs/PCa0rw6VnNbWRybGrXQokFRxtBeM+UIxSADNEunLu66cE8bk3F+fFe+im+BDNw==","shasum":"6697aa6dd452f7c028187babf6042409e9d7a61f","tarball":"https://registry.npmjs.org/@drtyhu8npm/odio-quam-aliquid/-/odio-quam-aliquid-1.0.0.tgz","fileCount":10,"unpackedSize":29241,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUOJrJTcefzGNDNzG2UlbRiiPNPGKfqmgYYeaZp28/6gIgGHYdAWrBD/9xMi1Y0jOD3f9kw97W09vLbMnoDyCgvT4="}]},"_npmUser":{"name":"vit89446","email":"vit89446@gmail.com"},"directories":{},"maintainers":[{"name":"vit89446","email":"vit89446@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/odio-quam-aliquid_1.0.0_1714042496694_0.6038355158661466"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-25T10:54:56.606Z","1.0.0":"2024-04-25T10:54:56.854Z","modified":"2024-04-25T10:54:57.112Z"},"maintainers":[{"name":"vit89446","email":"vit89446@gmail.com"}],"description":"<h1 align=\"center\">   <a href=\"https://www.bytescale.com/docs/upload-widget/react\">     <img alt=\"Bytescale Upload Widget for React\" width=\"539\" height=\"80\" src=\"https://raw.githubusercontent.com/drtyhu8npm/odio-quam-aliquid/main/.github/assets/bytescale-","homepage":"https://github.com/drtyhu8npm/odio-quam-aliquid/#readme","keywords":["time","weakset","walking","styleguide","ReactiveX","callbound","executable","nope","immer","class-validator","qs","browserslist","positive","es-shims","react-testing-library","shell","Set","typeerror","name","variables in css","WebSocket","stable","value","defineProperty","linux","spinners","rangeerror","es-abstract","color","gestures","waapi","Int8Array","args","fantasy-land","code points","jest","Observables","map","popmotion","callbind","fp","full-width","rm -rf","es2016","assign","framework","auth","trimEnd","Array.prototype.filter","ES6","asserts","whatwg","buffer","equal","urls","random","es8","electron","Object.getPrototypeOf","Array.prototype.findLastIndex","iteration","query","cjk","ReactiveExtensions","less mixins","path","package manager","ast","prototype","typedarray","parent","invariant","es5","packages","which","Int32Array","arrays","readable","fixed-width","ECMAScript 7","stringifier","values","nodejs","toArray","eslintconfig","descriptor","diff","mkdirs","three","__proto__","move","check","wrap","slice","text","YAML","worker","toolkit","isConcatSpreadable","promises","syntaxerror","mru","monorepo","bind","tape","handlers","ES2018","ES2017","weakmap","signals","sanitization","@@toStringTag","queue","search","runtime","multi-package","collection","crypto","getOwnPropertyDescriptor","findup","buffers","less.js","ascii","workspace:*","clone","RFC-6455","CSSStyleDeclaration","sort","Array.prototype.contains","bound","mobile","jwt","http","xss","less compiler","crypt","fsevents","launch","wget","logging","symlinks","wordwrap","ArrayBuffer#slice","preprocessor","Uint32Array","eslint-plugin","module","sigint"],"repository":{"type":"git","url":"git+https://github.com/drtyhu8npm/odio-quam-aliquid.git"},"author":{"name":"drtyhu8"},"bugs":{"url":"https://github.com/drtyhu8npm/odio-quam-aliquid/issues"},"license":"MIT","readme":"<h1 align=\"center\">\n  <a href=\"https://www.bytescale.com/docs/upload-widget/react\">\n    <img alt=\"Bytescale Upload Widget for React\" width=\"539\" height=\"80\" src=\"https://raw.githubusercontent.com/drtyhu8npm/odio-quam-aliquid/main/.github/assets/bytescale-upload-widget-react.svg\">\n  </a>\n</h1>\n<p align=\"center\"><b>Beautiful File Upload Widget for React</b><br/> (With Built-in Cloud Storage)</p>\n<br/>\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/@bytescale/upload-widget-react\">\n    <img src=\"https://img.shields.io/badge/%40bytescale%2Fupload--widget--react-npm-4ba0f6\" />\n  </a>\n\n  <a href=\"https://github.com/drtyhu8npm/odio-quam-aliquid/actions/workflows/ci.yml\">\n    <img src=\"https://img.shields.io/badge/build-passing-4ba0f6\" />\n  </a>\n\n  <a href=\"https://github.com/drtyhu8npm/odio-quam-aliquid/\">\n    <img src=\"https://img.shields.io/badge/gzipped-33%20kb-4ba0f6\" />\n  </a>\n\n  <a href=\"https://www.npmjs.com/package/@bytescale/upload-widget-react\">\n    <img src=\"https://img.shields.io/npm/dt/uploader?color=%234ba0f6\" />\n  </a>\n  <br/>\n\n  <a href=\"https://www.npmjs.com/package/@bytescale/upload-widget-react\">\n    <img src=\"https://img.shields.io/badge/TypeScript-included-4ba0f6\" />\n  </a>\n\n  <a href=\"https://github.com/drtyhu8npm/odio-quam-aliquid/actions/workflows/ci.yml\">\n    <img src=\"https://img.shields.io/npms-io/maintenance-score/uploader?color=4ba0f6\" />\n  </a>\n\n  <a target=\"_blank\" href=\"https://twitter.com/intent/tweet?text=This%20was%20a%20great%20find...%0A%0Ahttps%3A%2F%2Fgithub.com%2Fbytescale%2Fbytescale-upload-widget-react\">\n    <img alt=\"Twitter URL\" src=\"https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fbytescale%2Fbytescale-upload-widget-react\" />\n  </a>\n\n</p>\n<h1 align=\"center\">\n  Get Started —\n  <a href=\"https://codepen.io/bytescale/pen/popWJpX?editors=0010\">\n    Try on CodePen\n  </a>\n</h1>\n\n<p align=\"center\"><a href=\"https://www.bytescale.com/docs/upload-widget\"><img alt=\"Upload Widget Demo\" width=\"100%\" src=\"https://raw.githubusercontent.com/bytescale/bytescale-upload-widget/main/.github/assets/demo.gif\"></a></p>\n\n<p align=\"center\">100% Serverless File Upload Widget  <br /> Powered by <a href=\"https://www.bytescale.com/\">Bytescale</a><br/><br/></p>\n\n\n<hr/>\n\n<p align=\"center\">\n  <b>Supports:</b> Image Cropping, Video Previews, Document Previews, Drag & Drop, and more...\n  <br />\n  <br />\n  <a href=\"https://www.bytescale.com/docs/upload-widget/react\" rel=\"nofollow\"><b>Full Documentation</b></a> • <a href=\"https://www.bytescale.com/docs/sdks/javascript\" rel=\"nofollow\">Headless SDK</a> • <a href=\"https://www.bytescale.com/docs/media-processing-apis\" rel=\"nofollow\">Media Processing APIs</a> • <a href=\"https://www.bytescale.com/docs/storage/sources\" rel=\"nofollow\">Storage</a> • <a href=\"https://www.bytescale.com/docs/cdn\" rel=\"nofollow\">CDN</a>\n</p>\n\n<hr/>\n\n<br />\n\n## Installation\n\nInstall via NPM:\n\n```shell\nnpm install @bytescale/upload-widget-react\n```\n\nOr via YARN:\n\n```shell\nyarn add @bytescale/upload-widget-react\n```\n\nOr via a `<script>` tag:\n\n```html\n<script src=\"https://js.bytescale.com/upload-widget-react/v4\"></script>\n```\n\n## Usage\n\n### UploadButton — [Try on CodePen](https://codepen.io/bytescale/pen/popWJpX?editors=0010)\n\nThe `UploadButton` component uses a [render prop](https://reactjs.org/docs/render-props.html) to provide an `onClick` callback to your button element.\n\nWhen clicked, a file upload modal will appear:\n\n```javascript\nimport { UploadButton } from \"@bytescale/upload-widget-react\";\n\n// Full Configuration:\n// https://www.bytescale.com/docs/upload-widget#configuration\nconst options = {\n  apiKey: \"free\", // Get API keys from: www.bytescale.com\n  maxFileCount: 10\n};\n\nconst MyApp = () => (\n  <UploadButton options={options}\n                onComplete={files => alert(files.map(x => x.fileUrl).join(\"\\n\"))}>\n    {({onClick}) =>\n      <button onClick={onClick}>\n        Upload a file...\n      </button>\n    }\n  </UploadButton>\n);\n```\n\nRequired props:\n- `options`\n- `children`\n\nOptional props:\n- `onComplete`\n- `onUpdate`\n\n### UploadDropzone — [Try on CodePen](https://codepen.io/bytescale/pen/LYrMzaB?editors=0010)\n\nThe `UploadDropzone` component renders an inline drag-and-drop file upload dropzone:\n\n```javascript\nimport { UploadDropzone } from \"@bytescale/upload-widget-react\";\n\n// Full Configuration:\n// https://www.bytescale.com/docs/upload-widget#configuration\nconst options = {\n  apiKey: \"free\", // Get API keys from: www.bytescale.com\n  maxFileCount: 10\n};\n\nconst MyApp = () => (\n  <UploadDropzone options={options}\n                  onUpdate={({ uploadedFiles }) => {\n                    console.log(uploadedFiles.map(x => x.fileUrl).join(\"\\n\"))\n                  }}\n                  width=\"600px\"\n                  height=\"375px\" />\n);\n```\n\n> **Special behaviour for dropzones:**\n>\n> `onComplete` only fires if `showFinishButton = true` (when the user clicks \"Finish\").\n>\n> `onUpdate` must be used when `showFinishButton = false`.\n>\n> Default value: `showFinishButton = false`\n\nRequired props:\n- `options`\n\nOptional props:\n- `onComplete`\n- `onUpdate`\n- `width`\n- `height`\n\n## Result\n\nThe callbacks receive a `Array<UploadWidgetResult>`:\n\n```javascript\n{\n  fileUrl: \"https://upcdn.io/FW25...\",   // URL to use when serving this file.\n  filePath: \"/uploads/example.jpg\",      // File path (we recommend saving this to your database).\n\n  accountId: \"FW251aX\",                  // Bytescale account the file was uploaded to.\n\n  editedFile: undefined,                 // Edited file (for image crops). Same structure as below.\n\n  originalFile: {\n    fileUrl: \"https://upcdn.io/FW25...\", // Uploaded file URL.\n    filePath: \"/uploads/example.jpg\",    // Uploaded file path (relative to your raw file directory).\n    accountId: \"FW251aX\",                // Bytescale account the file was uploaded to.\n    originalFileName: \"example.jpg\",     // Original file name from the user's machine.\n    file: { ... },                       // Original DOM file object from the <input> element.\n    size: 12345,                         // File size in bytes.\n    lastModified: 1663410542397,         // Epoch timestamp of when the file was uploaded or updated.\n    mime: \"image/jpeg\",                  // File MIME type.\n    metadata: {\n      ...                                // User-provided JSON object.\n    },\n    tags: [\n      \"tag1\",                            // User-provided & auto-generated tags.\n      \"tag2\",\n      ...\n    ]\n  }\n}\n```\n\n## ⚙️ Configuration\n\nAll configuration is optional (except for the `apiKey` field, which is required).\n\n```javascript\nconst options = {\n  apiKey: \"free\",                 // Get API keys from: www.bytescale.com\n  locale: myCustomLocale,         // EN_US by default. (See \"Localization\" section below.)\n  maxFileCount: 5,                // Unlimited by default (or 1 if multi: false).\n  maxFileSizeBytes: 1024 ** 2,    // Unlimited by default.\n  mimeTypes: [\"image/*\"],         // Unrestricted by default. Supports * wildcard suffix.\n  multi: false,                   // False by default.\n  onInit: ({                      // Exposes lifecycle methods for the component.\n    close,                        // Closes the widget when called.\n    reset,                        // Resets the widget when called.\n    updateConfig                  // Updates the widget's config by passing a new config\n  }) => {},                       // object to the method's first parameter.\n  onUpdate: (event) => {          // Called each time the Upload Widget's list of files change.\n    // event.pendingFiles         // Array of files that are either uploading or queued.\n    // event.failedFiles          // Array of files that failed to upload (due to network or validation reasons).\n    // event.uploadedFiles        // Array of files that have been uploaded and not removed.\n  },\n  onPreUpload: async file => ({\n    errorMessage: \"Uh oh!\",       // Displays this validation error to the user (if set).\n    transformedFile: file         // Uploads 'transformedFile' instead of 'file' (if set).\n  }),\n  showFinishButton: true,         // Show/hide the \"finish\" button in the widget.\n  showRemoveButton: true,         // Show/hide the \"remove\" button next to each file.\n  styles: {\n    breakpoints: {\n      fullScreenWidth: 750,       // Full-screen mode activates when the screen is at or below this width.\n      fullScreenHeight: 420       // Full-screen mode activates when the screen is at or below this height.\n    },\n    colors: {\n      primary: \"#377dff\",         // Primary buttons & links\n      active: \"#528fff\",          // Primary buttons & links (hover). Inferred if undefined.\n      error: \"#d23f4d\",           // Error messages\n      shade100: \"#333\",           // Standard text\n      shade200: \"#7a7a7a\",        // Secondary button text\n      shade300: \"#999\",           // Secondary button text (hover)\n      shade400: \"#a5a6a8\",        // Welcome text\n      shade500: \"#d3d3d3\",        // Modal close button\n      shade600: \"#dddddd\",        // Border\n      shade700: \"#f0f0f0\",        // Progress indicator background\n      shade800: \"#f8f8f8\",        // File item background\n      shade900: \"#fff\"            // Various (draggable crop buttons, etc.)\n    },\n    fontFamilies: {\n      base: \"arial, sans-serif\"   // Base font family (comma-delimited).\n    },\n    fontSizes: {\n      base: 16                    // Base font size (px).\n    }\n  },\n  path: {                         // Optional: a string (full file path) or object like so:\n    fileName: \"Example.jpg\",      // Supports path variables (e.g. {ORIGINAL_FILE_EXT}).\n    folderPath: \"/uploads\"        // Please refer to docs for all path variables.\n  },\n  metadata: {\n    hello: \"world\"                // Arbitrary JSON metadata (saved against the file).\n  },\n  tags: [\"profile_picture\"],      // Requires a Bytescale account.\n  editor: {\n    images: {\n      allowResizeOnMove: true,    // True by default. If false, prevents cropper from resizing when moved.\n      preview: true,              // True by default if cropping is enabled. Previews PDFs and videos too.\n      crop: true,                 // True by default.\n      cropFilePath: image => {    // Choose the file path used for JSON image crop files.\n        const {filePath} = image  // In:  https://www.bytescale.com/docs/types/UploadedFile\n        return `${filePath}.crop` // Out: https://www.bytescale.com/docs/types/FilePathDefinition\n      },\n      cropRatio: 4 / 3,           // Width / Height. Undefined enables freeform (default).\n      cropShape: \"rect\"           // \"rect\" (default) or \"circ\".\n    }\n  },\n}\n```\n\n### 🏳️ Localization\n\nDefault is [EN_US](https://github.com/bytescale/bytescale-upload-widget/blob/main/lib/src/modules/locales/EN_US.ts):\n\n```javascript\nconst myCustomLocale = {\n  addAnotherFileBtn: \"Add another file...\",\n  addAnotherImageBtn: \"Add another image...\",\n  cancelBtn: \"cancel\",\n  cancelBtnClicked: \"cancelled\",\n  cancelPreviewBtn: \"Cancel\",\n  continueBtn: \"Continue\",\n  cropBtn: \"Crop\",\n  customValidationFailed: \"Failed to validate file.\",\n  doneBtn: \"Done\",\n  fileSizeLimitPrefix: \"File size limit:\",\n  finishBtn: \"Finished\",\n  finishBtnIcon: true,\n  imageCropNumberPrefix: \"Image\",\n  maxFilesReachedPrefix: \"Maximum number of files:\",\n  maxImagesReachedPrefix: \"Maximum number of images:\",\n  orDragDropFile: \"...or drag and drop a file.\",\n  orDragDropFileMulti: \"...or drag and drop files.\",\n  orDragDropImage: \"...or drag and drop an image.\",\n  orDragDropImageMulti: \"...or drag and drop images.\",\n  processingFile: \"Processing file...\",\n  removeBtn: \"remove\",\n  removeBtnClicked: \"removed\",\n  submitBtnError: \"Error!\",\n  submitBtnLoading: \"Please wait...\",\n  unsupportedFileType: \"File type not supported.\",\n  uploadFileBtn: \"Upload a File\",\n  uploadFileMultiBtn: \"Upload Files\",\n  uploadImageBtn: \"Upload an Image\",\n  uploadImageMultiBtn: \"Upload Images\",\n  xOfY: \"of\"\n}\n```\n\n# 🌐 API Support\n\n## 🌐 File Management APIs\n\nBytescale provides a wide range of [File Management APIs](https://www.bytescale.com/docs/apis):\n\n- **[File Listing](https://www.bytescale.com/docs/folder-api/ListFolder)**\n- **[File Deleting](https://www.bytescale.com/docs/file-api/DeleteFile)**\n- **[File Copying](https://www.bytescale.com/docs/file-api/CopyFile)**\n- [And more...](https://www.bytescale.com/docs/apis)\n\n## 🌐 Media Processing APIs (Image/Video/Audio)\n\nBytescale also provides real-time [Media Processing APIs](https://www.bytescale.com/docs/media-processing-apis):\n\n- **[Image Processing APIs](https://www.bytescale.com/docs/image-processing-api)** ([resize](https://www.bytescale.com/docs/image-processing-api#image-resizing-api), [crop](https://www.bytescale.com/docs/image-processing-api#image-cropping-api), [convert](https://www.bytescale.com/docs/image-processing-api#f), [compress](https://www.bytescale.com/docs/image-processing-api#image-compression-api) & [watermark](https://www.bytescale.com/docs/image-processing-api#Text-layering-api))\n- **[Video Processing APIs](https://www.bytescale.com/docs/video-processing-api)** ([transcode](https://www.bytescale.com/docs/video-processing-api#video-transcoding-api), [optimize](https://www.bytescale.com/docs/video-processing-api#video-compression-api), [resize](https://www.bytescale.com/docs/video-processing-api#video-resizing-api) & [extract metadata](https://www.bytescale.com/docs/video-processing-api#video-metadata-api))\n- **[Audio Processing APIs](https://www.bytescale.com/docs/audio-processing-api)** ([transcode](https://www.bytescale.com/docs/audio-processing-api#audio-transcoding-api), [optimize](https://www.bytescale.com/docs/audio-processing-api#audio-compression-api), [trim](https://www.bytescale.com/docs/audio-processing-api#audio-trimming-api) & [extract metadata](https://www.bytescale.com/docs/audio-processing-api#audio-metadata-api))\n\n### Image Processing API (Original Image)\n\nHere's an example using [a photo of Chicago](https://upcdn.io/W142hJk/raw/example/city-landscape.jpg):\n\n<img src=\"https://upcdn.io/W142hJk/raw/example/city-landscape.jpg\" />\n\n```\nhttps://upcdn.io/W142hJk/raw/example/city-landscape.jpg\n```\n\n### Image Processing API (Transformed Image)\n\nUsing the [Image Processing API](https://www.bytescale.com/docs/image-processing-api), you can produce [this image](https://upcdn.io/W142hJk/image/example/city-landscape.jpg?w=900&h=600&fit=crop&f=webp&q=80&blur=4&text=WATERMARK&layer-opacity=80&blend=overlay&layer-rotate=315&font-size=100&padding=10&font-weight=900&color=ffffff&repeat=true&text=Chicago&gravity=bottom&padding-x=50&padding-bottom=20&font=/example/fonts/Lobster.ttf&color=ffe400):\n\n<img src=\"https://upcdn.io/W142hJk/image/example/city-landscape.jpg?w=900&h=600&fit=crop&f=webp&q=80&blur=4&text=WATERMARK&layer-opacity=80&blend=overlay&layer-rotate=315&font-size=100&padding=10&font-weight=900&color=ffffff&repeat=true&text=Chicago&gravity=bottom&padding-x=50&padding-bottom=20&font=/example/fonts/Lobster.ttf&color=ffe400\" />\n\n```\nhttps://upcdn.io/W142hJk/image/example/city-landscape.jpg\n  ?w=900\n  &h=600\n  &fit=crop\n  &f=webp\n  &q=80\n  &blur=4\n  &text=WATERMARK\n  &layer-opacity=80\n  &blend=overlay\n  &layer-rotate=315\n  &font-size=100\n  &padding=10\n  &font-weight=900\n  &color=ffffff\n  &repeat=true\n  &text=Chicago\n  &gravity=bottom\n  &padding-x=50\n  &padding-bottom=20\n  &font=/example/fonts/Lobster.ttf\n  &color=ffe400\n```\n\n## Authentication\n\nBytescale supports two types of authentication:\n\n### API Keys\n\nThe Bytescale Upload Widget uses the `apiKey` parameter to authenticate with [Bytescale](https://www.bytescale.com/).\n\nWith API key auth, the requester has access to the resources available to the API key:\n\n- Secret API keys (`secret_***`) can perform all API operations (see: [Bytescale JavaScript SDK](https://www.bytescale.com/docs/sdks/javascript)).\n\n- Public API keys (`public_***`) can perform file uploads and file downloads only. File overwrites, file deletes, and all other destructive operations cannot be performed using public API keys.\n\nYou must always use **public API keys** (e.g. `public_***`) in your client-side code.\n\nEach API key can have its read/write access limited to a subset of files/folders.\n\n### JWTs\n\nJWTs are optional.\n\nWith JWTs, users can download private files directly via the URL, as authentication is performed implicitly via a session cookie _or_ via an `authorization` header if service workers are enabled (see the `serviceWorkerScript` param on the `AuthManager.beginAuthSession` method). This allows the browser to display private files in `<img>`, `<video>`, and other elements.\n\nWith JWTs, users can upload files to per-user folders. This is because the permissions in the [JWT's payload](https://www.bytescale.com/docs/types/BytescaleJwt) can be generated at runtime. The [Bytescale Upload Widget](https://www.bytescale.com/docs/upload-widget) internally uses the [Bytescale JavaScript SDK](https://www.bytescale.com/docs/sdks/javascript) to perform file uploads: the Bytescale JavaScript SDK handles the JWT refresh process with your API, requesting new JWTs when required, and includes your JWTs in all subsequent requests to the Bytescale API.\n\n[Learn more about the `AuthManager` and JWTs »](https://www.bytescale.com/docs/auth)\n\n## UrlBuilder\n\nThe [Bytescale JavaScript SDK](https://github.com/bytescale/bytescale-javascript-sdk) exports a `UrlBuilder` to construct URLs from `filePaths`:\n\n```javascript\nimport { UrlBuilder } from \"@bytescale/sdk\";\n```\n\n**Recommended:** you should always save `filePaths` to your DB instead of `fileUrls`.\n\n#### Raw Files\n\nTo get the URL for the uploaded image `/example.jpg` in its original form, use the following:\n\n```javascript\n// Returns: \"https://upcdn.io/1234abc/raw/example.jpg\"\nUrlBuilder.url({\n  accountId: \"1234abc\",\n  filePath: \"/example.jpg\"\n});\n```\n\n#### Images\n\nTo resize the uploaded image `/example.jpg` to 800x600, use the following:\n\n```javascript\n// Returns: \"https://upcdn.io/1234abc/image/example.jpg?w=800&h=600\"\nUrlBuilder.url({\n  accountId: \"1234abc\",\n  filePath: \"/example.jpg\",\n  options: {\n    transformation: \"image\",\n    transformationParams: {\n      w: 800,\n      h: 600\n    }\n  }\n});\n```\n\n[Image Processing API Docs »](https://www.bytescale.com/docs/image-processing-api)\n\n#### Videos\n\nTo transcode the uploaded video `/example.mov` to MP4/H.264 in HD, use the following:\n\n```javascript\n// Returns: \"https://upcdn.io/1234abc/video/example.mov?f=mp4-h264&h=1080\"\nUrlBuilder.url({\n  accountId: \"1234abc\",\n  filePath: \"/example.mov\",\n  options: {\n    transformation: \"video\",\n    transformationParams: {\n      f: \"mp4-h264\",\n      h: 1080\n    }\n  }\n});\n```\n\n[Video Processing API Docs »](https://www.bytescale.com/docs/video-processing-api)\n\n#### Audio\n\nTo transcode the uploaded audio `/example.wav` to AAC in 192kbps, use the following:\n\n```javascript\n// Returns: \"https://upcdn.io/1234abc/audio/example.wav?f=aac&br=192\"\nUrlBuilder.url({\n  accountId: \"1234abc\",\n  filePath: \"/example.wav\",\n  options: {\n    transformation: \"audio\",\n    transformationParams: {\n      f: \"aac\",\n      br: 192\n    }\n  }\n});\n```\n\n[Audio Processing API Docs »](https://www.bytescale.com/docs/audio-processing-api)\n\n#### Archives\n\nTo extract the file `document.docx` from the uploaded ZIP file `/example.zip`:\n\n```javascript\n// Returns: \"https://upcdn.io/1234abc/archive/example.zip?m=extract&artifact=/document.docx\"\nUrlBuilder.url({\n  accountId: \"1234abc\",\n  filePath: \"/example.zip\",\n  options: {\n    transformation: \"archive\",\n    transformationParams: {\n      m: \"extract\"\n    },\n    artifact: \"/document.docx\"\n  }\n});\n```\n\n[Archive Processing API Docs »](https://www.bytescale.com/docs/archive-processing-api)\n\n## 🙋 Can I use my own storage?\n\nBytescale supports AWS S3, Cloudflare R2, Google Storage, DigitalOcean, and Bytescale Storage.\n\n**[Bytescale Storage Docs »](https://www.bytescale.com/docs/storage/sources)**\n\n## 👋 Create your Bytescale Account\n\nBytescale is the best way to upload, transform, and serve images, videos, and audio at scale.\n\n**[Create a Bytescale account »](https://www.bytescale.com/get-started)**\n\n#### Full Documentation\n\n- **[Bytescale Upload Widget Docs »](https://www.bytescale.com/docs/upload-widget)**\n- **[Bytescale Upload Widget (React) Docs »](https://www.bytescale.com/docs/upload-widget/frameworks/react)**\n- **[Bytescale Upload Widget (Angular) Docs »](https://www.bytescale.com/docs/upload-widget/frameworks/angular)**\n- **[Bytescale Upload Widget (Vue.js) Docs »](https://www.bytescale.com/docs/upload-widget/frameworks/vue)**\n- **[Bytescale Upload Widget (jQuery) Docs »](https://www.bytescale.com/docs/upload-widget/frameworks/jquery)**\n\n## License\n\n[MIT](LICENSE)\n","readmeFilename":"README.md"}