function generateSignInLink(
    sessionId, opt_uid, opt_providerId, opt_forceSameDevice, opt_tenantId) {
  var url = 'https://www.example.com/signIn?mode=' +
      'signIn&apiKey=API_KEY&oobCode=ACTION_CODE';
  var builder = new firebaseui.auth.ActionCodeUrlBuilder(url);
  builder.setSessionId(sessionId);
  if (opt_uid) {
    builder.setAnonymousUid(opt_uid);
  }
  if (opt_providerId) {
    builder.setProviderId(opt_providerId);
  }
  if (opt_tenantId) {
    builder.setTenantId(opt_tenantId);
  }
  builder.setForceSameDevice(!!opt_forceSameDevice);
  return builder.toString();
}
Generates the email link sign-in URL with the requested parameters.
@param {string} sessionId The session identifier.
@param {?string=} opt_uid The optional anonymous user ID to be upgraded.
@param {?string=} opt_providerId The optional provider ID to link.
@param {boolean=} opt_forceSameDevice Whether to force same device flow.
@param {?string=} opt_tenantId The optional tenantId.
@return {string} The generated email action link.