new FrameClient({

FrameClient is a client that looks to the user like an ElvClient, but works by passing messages to another frame with an actual ElvClient instead of making the calls itself.

The purpose of this is to isolate users' private keys and the usage thereof in one trusted application, while still allowing other (possibly less trustworthy) applications to communicate with the content fabric on behalf of the user from a sandboxed IFrame.

FrameClient has available almost all of the same methods as ElvClient, and should be transparently interchangable with it from a usage perspective.

The methods available in FrameClient are generated automatically from ElvClient. These methods will use a messaging protocol to communicate intent to a specified frame, which can listen for such messages, perform the actions using the real ElvClient, and return the results via a response message.

Because the privileged frame is doing the actual work, it may decide to allow or disallow any actions it sees fit - for example, limiting a dependent app to a few safe calls while preventing it from making any significant changes.

The most important aspect of this architecture is to prevent leaking of users' private keys. Be careful when setting up a project using this architecture - make sure the untrusted app is properly contained in a sandboxed IFrame and served from a different origin than the privileged app.

  • test/frames/Parent.html and test/frames/Client.html for an example setup using this scheme
Name Type Description
target Object

The window or frame that will listen for messages produced by this client

timeout number

How long to wait for a response after calling a method before giving up and generating a timeout error



AllowedMethods() → Array.<string>

Returns: List of ElvClient methods available to a FrameClient


async PassRequest({request}) → object

Pass an ElvFrameRequest to the target and receive a ElvFrameResponse. Useful when acting as an intermediate between a contained app and a parent app.

Returns: The resultant ElvFrameResponse
Name Type Description
request object

An ElvFrameRequest

async PassRequest({
  "request": {
    "calledMethod": "ContentLibraries",
    "args": {},
    "type": "ElvFrameRequest",
    "requestId": 123
  "Respond": "<function>"

  "type": "ElvFrameResponse",
  "requestId": 123,
  "response": [
async PassRequest({
  "request": {
    "type": "ElvFrameRequest",
    "requestId": 1234,
    "calledMethod": "DownloadPart",
    "args": {
      "libraryId": "ilib3j1iarYtn2gs3T8t6wqgufwxgtNH",
      "objectId": "iq__2uKpqT1C2xtonWusjTUuJ7GrYVwg",
      "partHash": "hqp_8fUQ3kJWzWY62sTLwcirKQremLxuquS3ymLA8TEns7PVtmkZ",
      "chunked": true,
      "chunkSize": 10000,
      "callback": "<function>"
    "callbackId": 321
  "Respond": "<function>"

  "type": "ElvFrameResponse",
  "requestId": 1234