TypeError: Cannot read property 'get' of undefined when trying to read session.get on signin Widget

It seems that OktaSignIn.session is coming up undefined after the Widget is initialized.

Check out my code below:

The error:

TypeError: Cannot read property 'get' of undefined
    at LoginComponent.ngAfterViewInit (login.component.ts:101)
    at callProviderLifecycles (core.js:32327)
    at callElementProvidersLifecycles (core.js:32292)
    at callLifecycleHooksChildrenFirst (core.js:32274)
    at checkAndUpdateView (core.js:44280)
    at callViewAction (core.js:44636)
    at execEmbeddedViewsAction (core.js:44593)
    at checkAndUpdateView (core.js:44271)
    at callViewAction (core.js:44636)
    at execComponentViewsAction (core.js:44564)

Okta Widget service:

import { Injectable } from '@angular/core';
import * as OktaSignIn from '@okta/okta-signin-widget';
//import OktaSignIn from '@okta/okta-signin-widget/dist/js/okta-sign-in.min.js';
import { environment } from 'src/environments/environment';

export class OktaWidget {
  widget: OktaSignIn;

  constructor() {
    this.widget = new OktaSignIn({
      baseUrl: environment.oktaAuth.baseUrl,
      clientId: environment.oktaAuth.clientId,
      redirectUri: environment.oktaAuth.redirectUri,
      authParams: {
        issuer: environment.oktaAuth.issuer,

  getWidget() {
    return this.widget;

Angular component that intializes the Widget:

import { OktaWidget } from 'src/app/services/okta-widget.service';

export class AppComponent {

  constructor(private oktaWidget: OktaWidget) {
    this.oktaSignIn = oktaWidget.getWidget();

  ngAfterViewInit() {
    // ngOnInit doesn't work for this :( 
   // https://github.com/okta/okta-signin-widget/issues/278
   try {
      this.oktaSignIn.session.get((response) => {
        if (response.status !== 'INACTIVE') {
          console.log('response.status not inactive:', response.status);
          this.user = response.login;
        } else {
          console.log('response.status was inactive:', response.status);
    } catch (error) {
    // show login screen anyway...

I noticed that my OktaSignIn object doesn’t even have session, but rather an authClient.session, but authClient.session.get() results in GET https://dev-XXXXXX.okta.com/api/v1/sessions/me 404 (Not Found). So is the documentation inaccurate or am I configuring it wrong?