Fix base64 encoding for browser environment

The bufferToBase64 function from @binect/js expects Node.js Buffer
objects but was receiving browser ArrayBuffer, causing "[object ArrayBuffer]"
to be sent instead of valid base64. Use browser-native btoa() instead.

Also updates tests to work with @binect/js integration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-15 14:41:44 +01:00
parent be4377253e
commit 5bde27dcdd
6 changed files with 377 additions and 218 deletions

View File

@@ -2,6 +2,9 @@
"name": "binect-chrome",
"version": "1.0.0",
"description": "Chrome extension to send PDFs from cloud applications directly to Binect for physical mail delivery",
"dependencies": {
"@binect/js": "file:../binect-js"
},
"scripts": {
"build": "webpack --mode production",
"dev": "webpack --mode development --watch",