Ionic2 rc0 How to use @types for third-party libraries

I installed
npm install --save @types/gapi.auth2

How to import and use it?

don’t open a new thread for the same problem, it just isn’t necessary!

you already asked the same thing here: How to use TypeScript definitions @types in ionic2 project

read to get the idea of typings/@types

note: rc0 uses @types see the changelog:

all you have done now is installed typeScript definitions for Google API Client, did you install/add the Google API Client library too?

@fishgrind So sorry for duplicating, but I didn’t find solution :frowning:
I have installed
npm install --save @types/gapi

import { Component } from ‘@angular/core’;

import { NavController } from 'ionic-angular';

  selector: 'page-home',
  templateUrl: 'home.html'
export class HomePage {

  constructor(public navCtrl: NavController) {


	  var auth = gapi.auth2.init({
	    client_id: ''


<button ion-button (click)="test_init()">Test auth</button>

index.htm (add google api client)
<script src=""></script>

but it has error in console

Cannot read property 'init' of undefined

do you want to use google sign-in?

if so are you aware of this?

I want to use Google Drive API, and I need access_token.
If I use Google Plus native, it doesn’t run on browser