{"id":20471759,"url":"https://github.com/signiant/web-tapi-to-mediashuttle-sdk","last_synced_at":"2026-02-10T16:15:20.059Z","repository":{"id":233991086,"uuid":"657522000","full_name":"Signiant/web-tapi-to-mediashuttle-sdk","owner":"Signiant","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-27T17:46:30.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-05T13:49:01.304Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Signiant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-23T08:45:23.000Z","updated_at":"2023-06-23T08:58:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"68e4a2bc-123a-417a-ac20-06177f1afad8","html_url":"https://github.com/Signiant/web-tapi-to-mediashuttle-sdk","commit_stats":null,"previous_names":["signiant/web-tapi-to-mediashuttle-sdk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Signiant/web-tapi-to-mediashuttle-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fweb-tapi-to-mediashuttle-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fweb-tapi-to-mediashuttle-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fweb-tapi-to-mediashuttle-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fweb-tapi-to-mediashuttle-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Signiant","download_url":"https://codeload.github.com/Signiant/web-tapi-to-mediashuttle-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Signiant%2Fweb-tapi-to-mediashuttle-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269819032,"owners_count":24480087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T14:17:10.037Z","updated_at":"2026-02-10T16:15:20.031Z","avatar_url":"https://github.com/Signiant.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Migrating from Web Transfer API to Media Shuttle SDK\n\n\n## Introduction\n\nThe Media Shuttle SDK supports accelerated file transfers for modern JavaScript frameworks as an [npm module](https://www.npmjs.com/package/@signiant/media-shuttle-sdk). The Media Shuttle SDK supersedes the Web Transfer API (Web TAPI) JavaScript library that is no longer available, and it is recommended that any existing applications should migrate to the updated module to ensure continuity of support and additional functionality.\n\nFor more information about the SDK and how to get started with the Media Shuttle SDK, see the [SDK Documentation](https://github.com/Signiant/developer-portal/blob/main/docs/mediashuttle/getting-started-ms-sdk.md).\n\n## Differences\n\nUpdating to the Media Shuttle SDK requires significant modification to your application to work with the new entry point, transfer objects and functions, and authentication requirements.\n\nWeb TAPI uses an API key from the [Transfer API Key Manager](https://developer.mediashuttle.com), a transfer server address, user name, password and trust certificate in order to establish authentication and\ntransfer content. Media Shuttle SDK requires a user name, password and a Media Shuttle account name and portal name.\n\n**Note**: The Media Shuttle SDK does not automatically detect the Signiant App, and does not provide [app-less transfer](https://help.signiant.com/media-shuttle/signiant-app/transferring-without-signiant-app) functionality.\n\n\n\u003ctable\u003e\n  \u003cth\u003e\u003c/th\u003e\n  \u003cth\u003eWeb Transfer API\u003c/th\u003e\n  \u003cth\u003eMedia Shuttle SDK\u003c/th\u003e\n  \u003ctr\u003e\n    \u003ctd class=\"comparison\"\u003eEntry Point\u003c/td\u003e\n    \u003ctd class=\"comparison\"\u003e\n      \u003ccode class=\"prettyprint\"\u003eSigniant.Mst\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd class=\"comparison\"\u003e\n      \u003ccode class=\"prettyprint\"\u003eMediaShuttleResourceFactory\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd class=\"comparison\"\u003eTransfer Object\u003c/td\u003e\n    \u003ctd class=\"comparison\"\u003e\n      \u003ccode class=\"prettyprint\"\u003enew\u0026nbsp;Signiant.Mst.Upload()\u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd class=\"comparison\"\u003e\n      \u003ccode class=\"prettyprint\"\u003e\n        MediaShuttleResourceFactory.generateUpload(options)\n      \u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd class=\"comparison\"\u003eAuthentication Requirements\u003c/td\u003e\n    \u003ctd class=\"comparison\"\u003e\n      \u003ccode class=\"prettyprint\"\u003e\n        apikey \u003cbr /\u003e defaultServer \u003cbr /\u003e userName \u003cbr /\u003e password \u003cbr /\u003e{\" \"}\n        trustCertificate\n      \u003c/code\u003e\n    \u003c/td\u003e\n    \u003ctd class=\"comparison\"\u003e\n      \u003ccode class=\"prettyprint\"\u003e\n        userName \u003cbr /\u003e password \u003cbr /\u003e accountName \u003cbr /\u003e\n        portalName\n      \u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd class=\"comparison\"\u003eSigniant App Detection\u003c/td\u003e\n    \u003ctd class=\"comparison\"\u003eYes\u003c/td\u003e\n    \u003ctd class=\"comparison\"\u003eNo\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd class=\"comparison\"\u003eSigniant App Required \u003c/td\u003e\n    \u003ctd class=\"comparison\"\u003eNo\u003c/td\u003e\n    \u003ctd class=\"comparison\"\u003eYes\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n## Migration Tutorial\n\nThis tutorial will use an existing Web TAPI application to demonstrate how to convert a file transfer integration using the Media Shuttle SDK.\n\nTo get started, **fork** and **clone** this repository which contains the following applications:\n\n- `local_storage.html` - a sample application using the **Web Transfer API** and a Flight Deck agent that will act as a starting point.\n- `local_storage_migrated.html` - a completed example application using the **Media Shuttle SDK** and a Media Shuttle Share portal.\n\nBoth applications will upload content to an Amazon S3 bucket.\n\nThe repository also includes a sample integration in the `ms-sdk` directory.\n\n### Requirements\n\nThe [Getting Started documentation](https://github.com/Signiant/developer-portal/blob/main/docs/mediashuttle/getting-started-ms-sdk.md) outlines the requirements to use the Media Shuttle SDK.\n\nYou will require the following account information:\n\n- The Media Shuttle account name (`accountName`)\n- Valid Media Shuttle account information `(userName` and `password`)\n- The destination Share Portal name (`portalName`)\n- The destination folder path (`destinationFolderPath`)\n\n**Note**: The destination folder path is set to the portal root by default.\n\n### Creating the Module\n\n1. Create a new folder for the migration and copy the `local_storage.html` example file from the `web-tapi-to-mediashuttle-sdk` repository into a working directory and navigate to the directory:\n\n   **Linux:**\n\n   ```bash\n   mkdir tapi-migration\n   cp /path/to/repository/web-tapi-to-mediashuttle-sdk/local_storage.html tapi-migration/local_storage.html\n   cd tapi-migration\n   ```\n\n   **Windows:**\n\n   ```bash\n   mkdir tapi-migration\n   copy /path/to/repository/web-tapi-to-mediashuttle-sdk/local_storage.html tapi-migration/local_storage.html\n   cd tapi-migration\n   ```\n\n2. In the `tapi-migration` folder, make a copy of `local_storage.html` with the file name `local_storage_migrated.html`.\n\n   **Linux:**\n\n   ```bash\n   cp local_storage.html local_storage_migrated.html\n   ```\n\n   **Windows:**\n\n   ```bash\n   copy local_storage.html local_storage_migrated.html\n   ```\n\n3. In the `tapi-migration` folder, create and navigate to a new folder called `ms-sdk`:\n\n   ```bash\n   mkdir ms-sdk\n   cd ms-sdk\n   ```\n\n4. Use npm to install the `webpack-cli` and `webpack-dev-server` modules:\n\n   ```bash\n   npm install webpack webpack-cli webpack-dev-server --save-dev\n   ```\n\n5. Create a `webpack.config.js` with the following content:\n\n   ```javascript\n   const path = require(\"path\")\n   var webpack = require(\"webpack\")\n\n   module.exports = {\n     entry: \"./src/index.js\",\n     mode: \"none\",\n     output: {\n       filename: \"mediashuttle-bundle.js\",\n       path: path.resolve(__dirname, \"..\"),\n     },\n   }\n   ```\n\n   The webpack configuration uses the `./src/index.js` script as the application entry point, and will create a bundle named `mediashuttle-bundle.js` in the parent folder once compiled.\n\n6. Use npm to install the Media Shuttle SDK module:\n\n   ```\n   npm install @signiant/media-shuttle-sdk\n   ```\n\n7. Create a `src` directory\n\n   ```\n   mkdir src\n   ```\n\n8. Create an `index.js` file in the `ms-sdk/src` folder and add the following code to the file:\n\n   ```javascript\n   import * as MediaShuttleSDK from \"@signiant/media-shuttle-sdk\"\n\n   function initializeMSObject(userName, password) {\n     let creds = new MediaShuttleSDK.LoginCredentials({\n       username: userName, // A valid user name must be included\n       password: password, // A valid password must be included\n     })\n     return new MediaShuttleSDK.MediaShuttleResourceFactory(creds, {\n       platformApiEndpoint:\n         \"https://platform-api-service.services.cloud.signiant.com\",\n       messagingServiceUrl:\n         \"https://messaging-config-service.services.cloud.signiant.com\",\n     })\n   }\n\n   function getPortalOptions(\n     mediaShuttleResourceFactory,\n     accountName,\n     portalName\n   ) {\n     return mediaShuttleResourceFactory\n       .getExplorer()\n       .listAccounts(true)\n       .then(resp =\u003e {\n         const acct = resp.mediaShuttleAccounts.find(\n           item =\u003e item.name === accountName\n         )\n         if (typeof acct === \"undefined\") {\n           console.log(\"Returning undefined acct\")\n           return undefined\n         }\n         return acct\n       })\n       .then(acct =\u003e {\n         let accountId = acct.accountId\n         let serviceId = acct.serviceId\n         // Return new promise\n         return new Promise(function (resolve, reject) {\n           mediaShuttleResourceFactory\n             .getExplorer()\n             .listPortals({\n               accountId: accountId,\n               serviceId: serviceId,\n             })\n             .then(portals =\u003e {\n               resolve({\n                 acct: acct,\n                 portals: portals,\n               })\n             })\n         })\n       })\n       .then(res =\u003e {\n         console.log(res.portals)\n         const sharePortal = res.portals.find(\n           portal =\u003e portal.type === \"Share\" \u0026\u0026 portal.name === portalName\n         )\n         console.log(sharePortal)\n         if (typeof sharePortal === \"undefined\") {\n           console.log(\"Returning undefined portal\")\n           return undefined\n         }\n         let portalToUse = sharePortal\n         let portalId = portalToUse.portalId\n         return {\n           portalId: portalId,\n           serviceId: res.acct.serviceId,\n           accountId: res.acct.accountId,\n         }\n       })\n   }\n\n   function createUploadObject(\n     mediaShuttleResourceFactory,\n     portalOptions,\n     destinationFolderPath\n   ) {\n     let uploadOptions = {}\n     uploadOptions.portalId = portalOptions.portalId\n     uploadOptions.serviceId = portalOptions.serviceId\n     uploadOptions.accountId = portalOptions.accountId\n     uploadOptions.force = true\n     uploadOptions.destinationPath = destinationFolderPath\n     return mediaShuttleResourceFactory\n       .generateUpload(uploadOptions)\n       .then(uploader =\u003e {\n         return uploader\n       })\n       .catch(err =\u003e {\n         return undefined\n       })\n   }\n\n   function stageUpload(uploader, callback) {\n     // open a file selector and add files to the uploader\n     uploader.addFiles().then(files =\u003e {\n       console.log(JSON.stringify(files))\n       // start uploading the selected files through the callback function\n       callback(undefined, files)\n     })\n   }\n\n   window.initializeMSObject = initializeMSObject\n   window.getPortalOptions = getPortalOptions\n   window.stageUpload = stageUpload\n   window.createUploadObject = createUploadObject\n   ```\n\nThe `src/index.js` exposes functions to initialize `MediaShuttleResourceFactory`, to get portal options needed for transfer, and to get an upload object.\n\n### Compile the Module\n\nAfter completing the `index.js` example file, compile it as a module using npm:\n\n```\nnpm run build\n```\n\nThe `mediashuttle-bundle.js` file is created in the `tapi-migration` folder, and is ready to use in the `local_storage_migrated.html` example file.\n\n### Implement New Script\n\nReplace all scripts imported for Web TAPI with the bundled script out of webpack:\n\n```diff-html\n- \u003cscript src='https://example.com/transfer-api/2.7.4/transferapi.min.js' type='text/javascript'\u003e\u003c/script\u003e\n+ \u003cscript src='https://example.com/path/to/library/mediashuttle-bundle.js' type='text/javascript'\u003e\u003c/script\u003e\n```\n\n### Replace authentication variables\n\nReplace all variables used by Web TAPI for authentication:\n\n```diff-javascript\n- var apikey = '...';\n- var defaultServer = '....';\n- var userName = '....';\n- var password = '....';\n- var trustCertificate = '...'\n+ var userName = '....';\n+ var password = '....';\n+ var accountName = '.....';\n+ var portalName = '....';\n```\n\n### Replace/Add global transfer variables\n\nReplace the global transfer variable for upload used by WebTAPI with the SDK transfer variables.\n\n```diff-javascript\n- var transferObject = null;\n+ var mediaShuttleResourceFactory = null;\n+ var transferObject = null;\n+ var portalOptions = null;\n+ var uploadOptions = null;\n```\n\n### Replace on page ready function\n\nIn this example, when the page is ready, the function `checkForSigniant` is called to create the Signiant library, and then initialize the transfer object when the call succeeds. When migrating the application, you must modify the implementation of that function to call the Media Shuttle SDK entry point, `mediaShuttleResourceFactory`, and fallback on error. This is achieved by leveraging the `initializeMSObject` and `getPortalOptions` functions included in the JavaScript bundle.\n\n```javascript\nfunction checkForSigniant(failQuick) {\n  console.log(\"Check for Signiant App\")\n  mediaShuttleResourceFactory = initializeMSObject(userName, password)\n  if (mediaShuttleResourceFactory == undefined) {\n    appNotLoaded()\n  } else {\n    let opts = getPortalOptions(\n      mediaShuttleResourceFactory,\n      accountName,\n      portalName\n    )\n    const getOpts = () =\u003e {\n      opts.then(val =\u003e {\n        console.log(val)\n        if (val == undefined) {\n          appNotLoaded()\n        } else {\n          portalOptions = val\n        }\n      })\n    }\n    getOpts()\n  }\n}\n```\n\n**Note**: The Media Shuttle SDK does not prompt the user to install the Signiant App if it is not automatically detected. If this is required for your application, reach out to the [Signiant Developer Experience Team](mailto:signiantdeveloperexperience@signiant.com) for more information.\n\n### Create a transfer upload object\n\nUsing the following code sample, create a transfer upload object through the `initializeUploadObject()` function. We will implement the function in the application by using the `createUploadObject` function included in the new library:\n\n```javascript\nfunction initializeUploadObject() {\n  //create a new upload Object\n  let promise = createUploadObject(\n    mediaShuttleResourceFactory,\n    portalOptions,\n    destinationFolderPath\n  )\n  const getTransferObject = () =\u003e {\n    promise.then(val =\u003e {\n      console.log(val)\n      if (val !== undefined) {\n        transferObject = val\n        console.log(\"Transfer object \", transferObject)\n      }\n    })\n  }\n  getTransferObject()\n}\n```\n\nAdd the following code to use the Media Shuttle SDK to select files:\n\n```javascript\nfunction chooseFiles() {\n  if (transferObject !== undefined) {\n    transferObject.addFiles().then(files =\u003e {\n      // start uploading the selected files through the callback function\n      callbackUpload(undefined, files)\n    })\n    console.log(\"choose files: \", portalOptions)\n  }\n}\n\n/**\n * Callback when the file picker is closed.\n *\n * @return null\n */\n\nvar callbackUpload = function (event, selectedFiles) {\n  console.log(JSON.stringify(selectedFiles))\n  if (transferObject !== undefined) {\n    transferObject.start()\n    //modify the UI\n    $(\"#contentUploadText\").html(\"Starting upload...\")\n    $(\"#contentListing\").fadeTo(1000, 0.3)\n    $(\"#contentUpload\").on(\"click\", cancelUpload)\n  }\n}\n```\n\n**Note**: This sample application does not include the file progress and events handling.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigniant%2Fweb-tapi-to-mediashuttle-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigniant%2Fweb-tapi-to-mediashuttle-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigniant%2Fweb-tapi-to-mediashuttle-sdk/lists"}